0.1.11-1 • Published 3 years ago

jjsync v0.1.11-1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

jjsync

Synchronizes package.json and package.js

jjsync watches two files ( defaults are package.json and package.jsos ) and makes them sync'ed

Example

You just edited your package.jsos and commented task3:

{
  name : "jjsync",
  scripts : {
    task1 : "echo task1",
    task2 : "echo task2",
    //task3 : "echo task3"
  }
}

after saving package.json syncs:

{
  "name" : "jjsync",
  "scripts" : {
    "task1" : "echo task1",
    "task2" : "echo task2"
  }
}

then you install lodash library

yarn add lodash

after installation, package.json gets altered

{
  "name" : "jjsync",
  "scripts" : {
    "task1" : "echo task1",
    "task2" : "echo task2"
  },
  "dependencies" : {
    "lodash" : "^4.17.21"
  }
}

then package.jsos gets sync'ed

{
  name : "jjsync",
  scripts : {
    task1 : "echo task1",
    task2 : "echo task2",
    //task3 : "echo task3"
  },
  dependencies : {
    lodash : "^4.17.21"
  }
}

Usage

cd your-project
## defaults are json=package.json and js=package.jsos
npx jjsync [ json=json-file ] [ js=js-file ]

Considerations

js-file is created if it doesn't exist.

Comments are ignored outside of the main object {}

Because of beta status, ie if something may fail, every time a synchronization occurs, a file ( .package.json_history ) gets appended with the latest package.json content.