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

detective-es6

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective-es6 - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

.npmignore

2

index.js

@@ -6,3 +6,3 @@ var Walker = require('node-source-walk');

*
* @param {String} src
* @param {String|Object} src - File's content or AST
* @return {String[]}

@@ -9,0 +9,0 @@ */

{
"name": "detective-es6",
"version": "1.0.2",
"version": "1.1.0",
"description": "Get the dependencies of an es6 module",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"node-source-walk": "~1.3.0"
"node-source-walk": "~1.4.0"
},

@@ -30,0 +30,0 @@ "devDependencies": {

@@ -14,3 +14,9 @@ ### detective-es6 [![npm](http://img.shields.io/npm/v/detective-es6.svg)](https://npmjs.org/package/detective-es6) [![npm](http://img.shields.io/npm/dm/detective-es6.svg)](https://npmjs.org/package/detective-es6)

// Pass in a file's content or an AST
var dependencies = detective(mySourceCode);
```
#### License
MIT

@@ -5,2 +5,27 @@ var assert = require('assert');

describe('detective-es6', function() {
var ast = {
type: 'Program',
body: [{
type: 'VariableDeclaration',
declarations: [{
type: 'VariableDeclarator',
id: {
type: 'Identifier',
name: 'x'
},
init: {
type: 'Literal',
value: 4,
raw: '4'
}
}],
kind: 'let'
}]
};
it('accepts an ast', function() {
var deps = detective(ast);
assert(!deps.length);
});
it('retrieves the dependencies of es6 modules', function() {

@@ -7,0 +32,0 @@ var deps = detective('import {foo, bar} from "mylib";');

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