0.3.3 • Published 8 years ago

made-id v0.3.3

Weekly downloads
4
License
MIT
Repository
github
Last release
8 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

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago