Skip to content

Generate Neo4j schema from package-lock.json to vizualize dependencies

Notifications You must be signed in to change notification settings

krystxf/lockfiles-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lockfiles graph generator

This script generates Cypher query from package-lock.json file. Generated query could then be pasted in Neo4j Cypher shell and executed.

Generate from yarn.lock

Generates package-lock.json file in directory.

npx synp --source-file <path to yarn.lock>

Usage

python main.py <path to directory with package-lock.json> <export file>

Example

python main.py ../test/ generated.cypher

Generated file

Generated file will look something like this

CREATE (:Dependency {name: "argparse", version: "2.0.1", integrity: "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="})
CREATE (:Dependency {name: "invariant", version: "2.2.4", integrity: "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA=="})
CREATE (:Dependency {name: "js-tokens", version: "4.0.0", integrity: "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="})

About

Generate Neo4j schema from package-lock.json to vizualize dependencies

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages