app-require

0.1.1 • Public • Published

app-require

customized require for app. For sharing libs and easier to require with long relative path, ie ../.., easier to restructure code.

methods

setup(root)

  • root Default path, should be absolute path, if not set this will assume the current working directory

requireLib(path)

  • path path to lib folder, that is {path}/lib, default to root above.

requireConfig(path)

  • path path to config folder, that is {path}/config, default to root above.

require(id, path)

  • id module id/name or relative path
  • path path to load the id above, default to root above.

usage

Idea for application with structure as bellow

-approot/
----server.js
----/config/
----/lib/
....

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    2,339
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    2,339
  • 0.1.0
    0
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i app-require

Weekly Downloads

1,907

Version

0.1.1

License

none

Last publish

Collaborators

  • vanng822