Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 1021 Bytes

README.md

File metadata and controls

27 lines (16 loc) · 1021 Bytes

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=="})