require-hash
Require file paths relative to your projects package.json file using #
Last updated 4 years ago by kjones1876 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install require-hash 
SYNC missed versions from official npm registry.

Require-hash

This package allows you to require files relative to your projects package.json folder.

Usage:

# Project folder
.
├── README.md
└── src
    ├── app.js
    ├── lib
    │   └── search.js
    ├── modules
    │   └── user.js
    └── node_modules

# File: app.js
require('require-hash');

# File: modules/user.js
const search = require('#lib/search');

Change the symbol

The hash symbol can be changed to something else by called the updateSymbol method.

require('require-hash')
# File: app.js
require('require-hash').updateSymbol('@');

# File: modules/user.js
const search = require('@lib/search');

Current Tags

  • 0.0.6                                ...           latest (4 years ago)

6 Versions

  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 8
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |