detective-es6
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -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";'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3048
6
64
22
+ Addedacorn@1.2.2(transitive)
+ Addednode-source-walk@1.4.2(transitive)
- Removedacorn@0.10.0(transitive)
- Removednode-source-walk@1.3.0(transitive)
Updatednode-source-walk@~1.4.0