Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "require-at", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "require-at.js", | ||
@@ -17,2 +17,5 @@ "description": "Call require pretending your are at another directory", | ||
}, | ||
"files": [ | ||
"require-at.js" | ||
], | ||
"dependencies": {}, | ||
@@ -19,0 +22,0 @@ "devDependencies": { |
@@ -0,1 +1,4 @@ | ||
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] | ||
[![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-dev-image]][daviddm-dev-url] | ||
# require-at | ||
@@ -9,16 +12,14 @@ | ||
``` | ||
app1 | ||
|-+ foo | ||
| +-- index.js | ||
| +--+ node_modules | ||
| +--+ x | ||
| + ... | ||
app2 | ||
|-+ bar | ||
| +-- index.js | ||
| +--+ node_modules | ||
| +--+ y | ||
| + ... | ||
``` | ||
app1 | ||
|-+ foo | ||
| +-- index.js | ||
| +--+ node_modules | ||
| +--+ x | ||
| + ... | ||
app2 | ||
|-+ bar | ||
| +-- index.js | ||
| +--+ node_modules | ||
| +--+ y | ||
| + ... | ||
@@ -39,5 +40,3 @@ When you call `require("x")` in `/app1/foo/index.js`, NodeJS will search and find module `x` there. | ||
``` | ||
$ npm install require-at --save | ||
``` | ||
$ npm install require-at --save | ||
@@ -50,5 +49,5 @@ ## Usage | ||
- If you call it with just `dir`, then it returns a `require` function that's been binded to the directory `dir`. You can use it to load any module as if you are at `dir`. | ||
- You can also call `require.resolve` with the same effect. | ||
- If you call it with `dir` and a `request`, then it will load and return the module `request` as if at `dir`. | ||
- If you call it with just `dir`, then it returns a `require` function that's been binded to the directory `dir`. You can use it to load any module as if you are at `dir`. | ||
- You can also call `require.resolve` with the same effect. | ||
- If you call it with `dir` and a `request`, then it will load and return the module `request` as if at `dir`. | ||
@@ -75,1 +74,16 @@ ##### Example | ||
[travis-image]: https://travis-ci.org/jchip/require-at.svg?branch=master | ||
[travis-url]: https://travis-ci.org/jchip/require-at | ||
[npm-image]: https://badge.fury.io/js/require-at.svg | ||
[npm-url]: https://npmjs.org/package/require-at | ||
[daviddm-image]: https://david-dm.org/jchip/require-at/status.svg | ||
[daviddm-url]: https://david-dm.org/jchip/require-at | ||
[daviddm-dev-image]: https://david-dm.org/jchip/require-at/dev-status.svg | ||
[daviddm-dev-url]: https://david-dm.org/jchip/require-at?type=dev |
@@ -10,4 +10,4 @@ "use strict"; | ||
const orig_findPath = Module._findPath; | ||
const contextExt = ".____context____"; | ||
const contextFname = `____resolve____${contextExt}`; | ||
const contextExt = "._require_at_"; | ||
const contextFname = `._hook_${contextExt}`; | ||
@@ -14,0 +14,0 @@ Module._findPath = function (request, paths, isMain) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4567
86
3