Socket
Book a DemoInstallSign in
Socket

keyword-brunch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyword-brunch

Adds keyword processing support to brunch.io application packager.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

keyword-brunch

A brunch plugin to replace predefined keywords of public files after every compilation.

Usage

Install

Add "keyword-brunch": "x.y.z" to package.json of your brunch app. Pick a plugin version that corresponds to your minor (y) brunch version.

If you want the latest repository version, install the plugin by running the following command:

npm install --save "git+ssh://git@github.com:huafu/keyword-brunch.git"

Usage in your application

Usage:

module.exports = 
  keyword:
    # file filter
    filePattern: /\.(js|css|html)$/

    # Extra files to process which `filePattern` wouldn't match
    extraFiles: [
      "public/humans.txt"
    ]

    # By default keyword-brunch has these keywords:
    #     {!version!}, {!name!}, {!date!}, {!timestamp!}
    # using information from package.json
    map:
      myDate: -> (new Date).toISOString()
      someString: "hello"

The plugin will replace any keyword in map surrounded with '{!' and '!}' by the result of the given associated function or with the given associated string. The functions are re-calculated on every build, but only once per build, not at every file. So you can make some keywords for the current git repository branch, commit hash, ...

Keywords

brunch

FAQs

Package last updated on 03 Jan 2017

Did you know?

Socket

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