Socket
Socket
Sign inDemoInstall

conff

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    conff

Generate command line flags from a standard config file.


Version published
Maintainers
1
Install size
5.16 kB
Created

Readme

Source

conff

Generate command line flags from a standard config file.

Quick start
  1. npm install conff -g
  2. Define a conff.json file in the root of your project.
{

    "watch": [
        "watchify"
        ,"app.js"
        ,{
            "transform": ["browserify-css"]
            , "outfile": "bundle.min.js"
            , "verbose": true
        }
    ]

    ,"compile": [
        "browserify"
        "app.js"
        ,{ "transform": ["browserify-css"] }
    ]

    ,"compress": ["uglifyjs", { "mangle": true, "compress": true }]
}

Then in bash:

`conff compile` | `conf compress` > bundle.min.js

The above command will expand into:

browserify app.js --transform browserify-css | uglifyjs --mangle --compress > bundle.min.js

If you are on windows you can use --exec and --pipe:

conff compile --exec | conff compress --pipe --exec
Why?
  • A single configuration file for any bash command simplifies your build scripts.

  • Defining configuration in one place illuminates the relationship between different scripts

  • Editing json is easier than editing command line flags

  • Encourages use of verbose flags instead of single letter options

  • Removes the need for project specific config files with their own particular translation logic

JSON structure

The top level key is the name of your command. The top level value should be an array containing either:

  • a string
  • an array
  • an object of key values
Arrays:

A sub array follows the same rules as the top level array, and can be arbitrarily nested.

Objects:

Objects will not be deeply traversed they are only a key:value store. If a value is a boolean, only the key will be added.

Strings

Strings are inserted verbatim in order. They will usually be either filenames or commands.

Roadmap

conff is a tiny script. I expect it will not change much (if at all), but pull requests are welcome and encouraged!

FAQs

Last updated on 26 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc