copy-partial-json
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.4 • Public • Published

    copy-partial-json

    A simple script to copy portions of a json document from one file to another

    npm Build Status NPM Typescript

    To copy the version, name and dependency list from a root package.json to child packages:

    $ copy-partial-json -s package.json -t one/package.json -t two/package.json -k version name dependencies

    Using npm scripts this can be done automatically when npm version is run:

    {
        "scripts": {
            "version": "copy-partial-json -g -t childOne/package.json -k version"
        }
    }

    Options

    Argument Alias Type Description
    sourceFile s string The json file to copy from. Defaults to 'package.json'
    targetFile t string[] The json file to copy to
    keys k string[] The keys to copy. For example, 'version,name,dependencies'
    jsonIndent i number The number of spaces to indent your json file by. Defaults to 4.
    gitAdd g boolean adds any target files to git after updating
    help h boolean Show this help text

    Install

    npm i copy-partial-json

    DownloadsWeekly Downloads

    106

    Version

    1.1.4

    License

    ISC

    Unpacked Size

    77 kB

    Total Files

    31

    Last publish

    Collaborators

    • roaders