File tree 3 files changed +16
-3
lines changed
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ const inspect = require ( '../dist/index' )
3
+
4
+ inspect . buildDepTreeFromFiles ( './' , 'package.json' , 'package-lock.json' )
5
+ . then ( ( tree ) => {
6
+ console . log ( JSON . stringify ( tree ) ) ;
7
+ } )
8
+ . catch ( ( e ) => {
9
+ console . log ( e ) ;
10
+ } ) ;
Original file line number Diff line number Diff line change 2
2
"name" : " snyk-nodejs-lockfile-parser" ,
3
3
"description" : " Generate a dep tree given a lockfile" ,
4
4
"main" : " dist/lib/index.js" ,
5
+ "bin" : {
6
+ "parse" : " ./bin/index.js"
7
+ },
5
8
"scripts" : {
6
9
"test" : " npm run lint && npm run unit-test" ,
7
10
"unit-test" : " tap test/lib -R=spec --timeout=300 --node-path ts-node --test-file-pattern '/\\ .[tj]s$/'" ,
Original file line number Diff line number Diff line change 3
3
// See: https://github.com/tapjs/node-tap/issues/313#issuecomment-250067741
4
4
// tslint:disable:max-line-length
5
5
// tslint:disable:object-literal-key-quotes
6
- import { test } from 'tap' ;
6
+ import { test } from 'tap' ;
7
7
import * as sinon from 'sinon' ;
8
- import parseLockFile from '../../lib' ;
8
+ import { buildDepTreeFromFiles } from '../../lib' ;
9
9
import * as fs from 'fs' ;
10
10
11
11
const load = ( filename ) => fs . readFileSync (
@@ -14,7 +14,7 @@ const load = (filename) => fs.readFileSync(
14
14
test ( 'Parse npm package-lock.json' , async ( t ) => {
15
15
const expectedDepTree = load ( 'goof/dep-tree_small.json' ) ;
16
16
17
- const depTree = await parseLockFile (
17
+ const depTree = await buildDepTreeFromFiles (
18
18
`${ __dirname } /fixtures/goof/` ,
19
19
'package.json' ,
20
20
'package-lock.json' ,
You can’t perform that action at this time.
0 commit comments