diet-use

0.0.3 • Public • Published

Use

Require files, modules and directories too

Install

npm install diet-use

Require

  • files: use('/path/to/file.js') - this includes a single file
  • modules: use('/path/to/module') - this includes a default or a custom module
  • directories: use('/path/to/directory') - This includes all .js files in a directory

How does module requireing work?

It will traverse up from the current directory to search for a module in a node_modules folder until it finds it. If no modules match it will try to inlcude the directory.

Example

// file structure
- root
    - node_modules
        - matrix
    - project
        - server.js
// in server.js
use('matrix');

Versions

Current Tags

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

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.1
    1

Package Sidebar

Install

npm i diet-use

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • adamhalasz