jsep

WebJar for jsep

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

jsep
Последняя версия

Последняя версия

0.3.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

jsep
WebJar for jsep
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/EricSmekens/jsep

Скачать jsep

Имя Файла Размер
jsep-0.3.5.pom
jsep-0.3.5.jar 345 KB
jsep-0.3.5-sources.jar 22 bytes
jsep-0.3.5-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/jsep/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>jsep</artifactId>
    <version>0.3.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/jsep/
implementation 'org.webjars.npm:jsep:0.3.5'
// https://jarcasting.com/artifacts/org.webjars.npm/jsep/
implementation ("org.webjars.npm:jsep:0.3.5")
'org.webjars.npm:jsep:jar:0.3.5'
<dependency org="org.webjars.npm" name="jsep" rev="0.3.5">
  <artifact name="jsep" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='jsep', version='0.3.5')
)
libraryDependencies += "org.webjars.npm" % "jsep" % "0.3.5"
[org.webjars.npm/jsep "0.3.5"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

jsep: A Tiny JavaScript Expression Parser

jsep is a simple expression parser written in JavaScript. It can parse JavaScript expressions but not operations. The difference between expressions and operations is akin to the difference between a cell in an Excel spreadsheet vs. a proper JavaScript program.

Why jsep?

I wanted a lightweight, tiny parser to be included in one of my other libraries. esprima and other parsers are great, but had more power than I need and were way too large to be included in a library that I wanted to keep relatively small.

jsep's output is almost identical to esprima's, which is in turn based on SpiderMonkey's.

Custom Build

First, install Grunt. While in the jsep project directory, run:

npm install .
grunt

The jsep built files will be in the build/ directory.

Usage

Client-side

<script src="/PATH/TO/jsep.min.js" type="text/javascript"></script>
...
var parse_tree = jsep("1 + 1");

Node.JS

First, run npm install jsep. Then, in your source file:

var jsep = require("jsep");
var parse_tree = jsep("1 + 1");

Custom Operators

// Add a custom ^ binary operator with precedence 10
jsep.addBinaryOp("^", 10);

// Add a custom @ unary operator
jsep.addUnaryOp('@');

// Remove a binary operator
jsep.removeBinaryOp(">>>");

// Remove a unary operator
jsep.removeUnaryOp("~");

License

jsep is under the MIT license. See LICENSE file.

Thanks

Some parts of the latest version of jsep were adapted from the esprima parser.

Версии библиотеки

Версия
0.3.5
0.3.4