literal-require

1.0.5 • Public • Published

Nodejs literal templating for node native require module.

Usage

npm i literal-require --save
require('literal-require')

Add namespace to your application package.json

{
  ...

  -> "namespace": {
    "@application": "${ process.cwd() }/application"
  }
}

Then use in your require's as follows

require('@application/config.json')

require('@application/example-module')

require('path').literal('@application')

Will resolve the path with pre-evaluated literal key/value.

require('literal-require).add(namespace, path)

Adds namespace to be used later with require or path.literal

Readme

Keywords

none

Package Sidebar

Install

npm i literal-require

Weekly Downloads

5

Version

1.0.5

License

ISC

Unpacked Size

3.11 kB

Total Files

3

Last publish

Collaborators

  • pwalczak