1.1.4 • Published 5 years ago

map-path v1.1.4

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

map-path

Create aliases of module paths

npm.io

useage

let utils = require("map-path")("Utils");
let utilsUrl = require("map-path")("Utils", "url");
let Button = require("map-path")("Components/Button", "url"); //url priority,Button.js,Button/index.js only support js prefix now

map path in map-path.js which in the root dir

const nodepath = require("path");
module.exports = {
  Utils: './utils',//if not absulte path,will add prefix cwd to it,cwd is base where your map-path.js locate
  Components: nodepath.join(cwd, "components")
};

if not in rootPath

require("map-path").setRoot('./env');

if transform mapPath config

require('map-path').setStore({//cwd is your root dir
  Utils:'./utils',
  Components:nodepath.join(cwd,"components")
})

fix

  • add test
1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago