0.3.3 • Published 9 years ago

made-id v0.3.3

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

#Made-ID Build Status

find moduel real path use id and generate short_id from path

Install

npm install made-id

Options

options = {
  basedir: '', //use for find module
  entry: '', //module entry file, such as: index.jade
  ext: '', //module ext file name, such as: .jade
};

API

.id(filename, options)

generate module id from filename

.sid(filename, options)

options.dev

default: false if options.dev is true, this will genreate a sid like id. you can find module's path according sid.

.path(id, options)

find module real path

options.filename

Usage

var mid = require('../index.js');

var options = {
  basedir: '/home/simonhao/project/pomelo/src/',
  entry: 'view.jade',
  ext: '.jade'
};

console.log('filename ==> id');
console.log(mid.id('/home/simonhao/project/pomelo/src/comm/module/header/view.jade', options));
// comm/module/header

console.log(mid.id('/home/simonhao/project/pomelo/src/comm/style/footer.jade', options));
// comm/style/footer
0.3.3

9 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago