Socket
Socket
Sign inDemoInstall

esprima

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esprima - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

22

package.json

@@ -10,3 +10,3 @@ {

},
"version": "3.0.0",
"version": "3.1.0",
"files": [

@@ -17,3 +17,3 @@ "bin",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},

@@ -43,7 +43,6 @@ "author": {

"everything.js": "~1.0.3",
"glob": "~7.0.0",
"glob": "~7.1.0",
"istanbul": "~0.4.0",
"jscs": "~3.0.3",
"json-diff": "~0.3.1",
"karma": "~1.2.0",
"karma": "~1.3.0",
"karma-chrome-launcher": "~2.0.0",

@@ -53,7 +52,7 @@ "karma-detect-browsers": "~2.1.0",

"karma-ie-launcher": "~1.0.0",
"karma-mocha": "~1.1.1",
"karma-mocha": "~1.2.0",
"karma-safari-launcher": "~1.0.0",
"karma-sauce-launcher": "~1.0.0",
"lodash": "~3.10.1",
"mocha": "~3.0.2",
"mocha": "~3.1.0",
"node-tick-processor": "~0.0.2",

@@ -64,3 +63,3 @@ "regenerate": "~1.3.1",

"typescript": "~1.8.10",
"typescript-formatter": "~1.2.0",
"typescript-formatter": "~2.3.0",
"unicode-8.0.0": "~0.7.0",

@@ -80,4 +79,4 @@ "webpack": "~1.13.2"

"tslint": "tslint src/*.ts",
"code-style": "tsfmt --verify src/*.ts && jscs -p crockford test/*.js",
"format-code": "tsfmt -r src/*.ts",
"code-style": "tsfmt --verify src/*.ts && tsfmt --verify test/*.js",
"format-code": "tsfmt -r src/*.ts && tsfmt -r test/*.js",
"complexity": "node test/check-complexity.js",

@@ -96,2 +95,3 @@ "static-analysis": "npm run check-version && npm run tslint && npm run code-style && npm run complexity",

"saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js",
"saucelabs": "npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari",
"analyze-coverage": "istanbul cover test/unit-tests.js",

@@ -112,3 +112,3 @@ "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100",

"appveyor": "npm run compile && npm run all-tests && npm run browser-tests",
"droneio": "npm test && npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari",
"droneio": "npm run compile && npm run all-tests && npm run saucelabs",
"generate-regex": "node tools/generate-identifier-regex.js",

@@ -115,0 +115,0 @@ "generate-xhtml-entities": "node tools/generate-xhtml-entities.js"

@@ -23,14 +23,11 @@ [![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima)

Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript programs.
Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program.
A simple example:
A simple example on Node.js REPL:
```javascript
var esprima = require('esprima');
var code = 'const answer = 42';
var tokens = esprima.tokenize(code);
var ast = esprima.parse(code);
```
which gives a list of [tokens](https://en.wikipedia.org/wiki/Lexical_analysis#Token):
```javascript
> var esprima = require('esprima');
> var program = 'const answer = 42';
> esprima.tokenize(program);
[ { type: 'Keyword', value: 'const' },

@@ -40,5 +37,4 @@ { type: 'Identifier', value: 'answer' },

{ type: 'Numeric', value: '42' } ]
```
and an [abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree):
```javascript
> esprima.parse(program);
{ type: 'Program',

@@ -45,0 +41,0 @@ body:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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