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

Readme

Keywords

Package Sidebar

Install

npm i apemanconst

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • okunishinishi