0.3.0 • Published 9 years ago

pfade v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Pfade

This is a basic route normalizing library. It helps in avoiding relative paths.

Installation

    npm install pfade

Usage

Instead of using the relative paths

    require('../../something.js')

you can use

    var Pfade = require('pfade')
    var pfade = new Pfade(__dirname) // specify the absolute path to your project
    var index = pfade.require('index.js')
    var handle = pfade.require('modules/handle.js')
    console.log(handle)

This reduces the ugly relative path requires. After the first instantiation, you won't have to provide the absolute address of the project.

You can just instantiate

    var Pfade = require('pfade')
    var pfade = new Pfade()

License

MIT