Giter VIP home page Giter VIP logo

require-relative's Introduction

require-relative

require-relative is a node.js program to require and resolve modules relative to a path of your choice. It exploits node.js's own module module, and has no additional dependencies.

Example

requiring modules relatively

var relative = require('require-relative');

var someModule = relative('./some-module', '/home/kamicane');
var somePackage = relative('some-package', '/home/kamicane');
var isTrue = relative('./some-module.js', process.cwd()) === relative('./some-module.js');

resolving filenames relatively

var relative = require('require-relative');

relative.resolve('./some-module', '/home/kamicane'); // /home/kamicane/some-module.js
relative.resolve('some-package', '/home/kamicane'); // /home/kamicane/node_modules/some-package/index.js
var isTrue = relative.resolve('./some-module.js', process.cwd()) === relative.resolve('./some-module.js');

require-relative's People

Contributors

kamicane avatar

Stargazers

dufemeng avatar Jim Fisk avatar fox avatar  avatar Svyatoslav avatar Simon Fridlund avatar Adrian Perez avatar Vincenzo Ferrari avatar  avatar Dylan Piercey avatar Fishine Yuan avatar Lucas Bento avatar Alex avatar Yukino Song avatar 平江 avatar Joe Spencer avatar Benjamin E. Coe avatar Stefano Cudini avatar Dan Phillimore avatar Stephan Bönnemann-Walenta avatar Michael Anthony avatar Andrew Bradley avatar Arian Stolwijk avatar

Watchers

 avatar James Cloos avatar Michael Anthony avatar  avatar

require-relative's Issues

No proper copyright assignment

Hi,

package.json does say who the author is, and what the license is. But the problem is that there is no proper copyright written anywhere, and the license isn't even quoted in its entirety... even though it's one of its requirements!

You might want to have a look at this detailed explanation.

Thanks,

Snark on #debian-js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.