2.0.0 • Published 8 years ago

apemanconst v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

apemanconst

Build Status Code Climate Code Coverage npm Version JS Standard

Demo of service project.

Installation

$ npm install apemanconst --save

Usage

Create a directory with name "consts" and put const files like "en.json" there.

consts/foo.json

{
  "message":"This is #{myName}"
}

consts/index.js

'use strict'

const apemanconst = require('apemanconst')

// Exports consts as module.
let consts = apemanconst(__dirname, {
  // Options
  vars: {
    myName: 'deep blue'
  }
})

// Print all consts
consts.print()

module.exports = consts

Then,

'use strict'

// Require defined consts
const consts = require('./consts/index.js')

let foo = consts('foo')
console.log(foo.message) // -> "This is deep blue"

License

This software is released under the MIT License.

Links

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago