requiro

1.8.0 • Public • Published

requiro

Advanced version of require for node.js.

INSTALL

npm install requiro

USAGE

var require = require("requiro");
// Now we can use something like that:
var conf = require(">/config.{%NODE_ENV%}.js");
var car = require("~/app/models/car");

SYNTAX

Symbols Resolves to Example
> or >/ Current working directory require(">/app/library/index.js")
{%VAR} or {%VAR%} Environment variable require("./config.{%NODE_ENV%}.js")
~/ Closest directory with package.json require("~/app/library")
// Project root require("//app/models/car")

TODO

  1. Need put config somewhere
  2. Multiple environment variables

INSPIRED BY

https://github.com/MattiSG/requirewith
https://github.com/jaubourg/wires

CHANGELOG

May 1, 2015

  • first release

Dec 13, 2015

  • added project root token //
  • added closest directory with package.json /~

Package Sidebar

Install

npm i requiro

Weekly Downloads

4

Version

1.8.0

License

Beerware

Last publish

Collaborators

  • iamthes