Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jseb

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jseb

JavaScript Expression Builder which build JS expression from jsep parsed AST tokens.

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jseb

JavaScript Expression Builder which build JS expression from jsep parsed AST tokens.

The purpose of this package is for building parsed AST back to JS expression with additional injection. You can do some preprocess before build by register one handler each token type.

Usage

Browser

<script src="/PATH/TO/jseb.js" type="text/javascript"></script>
<script type="text/javascript">
var exp = jseb(jsep('a+1')); // 'a+1'
</script>

Node.js

var jsep = require('jsep');
var jseb = require('jseb');
jseb(jsep('a+1')); // 'a+1'

Preprocessor

var jseb = require('jseb');
jseb.registerPreprocessor(jseb.MEMBER_EXP, function (token) {
    // anything you like to preprocess the token
    // ...
    return token;
});

Token Types

All the token types are from jsep except ACCESSOR.

  • jseb.IDENTIFIER
  • jseb.ACCESSOR (extended)
  • jseb.MEMBER_EXP
  • jseb.LITERAL
  • jseb.THIS_EXP
  • jseb.CALL_EXP
  • jseb.UNARY_EXP
  • jseb.BINARY_EXP
  • jseb.LOGICAL_EXP
  • jseb.CONDITIONAL_EXP
  • jseb.ARRAY_EXP

MIT Licensed

-EOF-

Keywords

FAQs

Package last updated on 01 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc