tapc-parse-dep

0.2.5 • Public • Published

tapc-parse-dep

Test coverage Build Status Dependency Status devDependency Status NPM version node License npm download

从KMD、KISSY5、AMD源码中解析模块依赖

Install

$ npm install --save tapc-parse-dep

Usage

var parseDep = require('tapc-parse-dep');
var rst = {};
var file = new Vinyl({/*...*/}); //仅能接收Vinyl格式文件
parseDep(file, rst, {
  localBasePath: './test/AMD', //指定基础路径
  name: 'AMD' //指定路径替代名称
});
/*
 rst: {
   '模块名称': {
     requires: []//依赖列表
   }
 }
*/

Configuration

名称 类型 描述 必填 默认值
name String 仓库名称 yes
localBasePath String 基础路径 yes
wrapAMDWhenNoExports Boolean 是否在没有module.exports时包裹AMD no true

Test

$ npm run build # build the source code with babel 
$ npm run dev # build automatically when files change 
$ npm run test # run unit tests 

License

The MIT License (MIT)

Copyright (c) 2015 tmallfe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i tapc-parse-dep

Weekly Downloads

7

Version

0.2.5

License

MIT

Unpacked Size

38.1 kB

Total Files

61

Last publish

Collaborators

  • skyinlayer
  • szmtcjm