apemanconst
Demo of service project.
Last updated 4 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apemanconst 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.0                                ...           latest (4 years ago)

4 Versions

  • 2.0.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (9)

Copyright 2014 - 2016 © taobao.org |