apemanconst

2.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i apemanconst

Weekly Downloads

4

Version

2.0.0

License

MIT

Last publish

Collaborators

  • okunishinishi