Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "ranma", | ||
"version": "0.0.2", | ||
"description": "a converter between CommonJS and XMD(AMD/CMD)", | ||
"version": "0.0.3", | ||
"description": "A converter between CommonJS/AMD/CMD/other", | ||
"maintainers": [ | ||
{ | ||
"name": "army8735", | ||
"email": "army8735@qq.com" | ||
} | ||
"email": "army8735@qq.com" | ||
} | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "make test" | ||
}, | ||
"config": { | ||
"blanket": { | ||
"pattern": ["amdify.js", | ||
"cmdify.js", | ||
"cjsify.js", | ||
"ranma.js", | ||
"type.js", | ||
"exist.js"] | ||
} | ||
}, | ||
"repository": { | ||
@@ -19,4 +29,4 @@ "type": "git", | ||
"keywords": [ | ||
"converter", | ||
"commonjs", | ||
"convert", | ||
"commonjs", | ||
"amd", | ||
@@ -26,9 +36,6 @@ "cmd" | ||
"author": "army8735", | ||
"license": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/addyosmani/es6-module-loader/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"dependencies": {}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"homunculus": "0.0.19" | ||
}, | ||
"main": "./ranma", | ||
@@ -38,3 +45,10 @@ "engines": { | ||
}, | ||
"readmeFilename": "README.md" | ||
"readmeFilename": "README.md", | ||
"devDependencies": { | ||
"expect.js": "^0.3.1", | ||
"mocha": "^1.18.2", | ||
"blanket": "^1.1.6", | ||
"coveralls": "^2.10.0", | ||
"mocha-lcov-reporter": "0.0.1" | ||
} | ||
} |
35
ranma.js
@@ -1,18 +0,17 @@ | ||
exports.cj2amd = function(code) { | ||
return ''; | ||
} | ||
exports.cj2cmd = function(code) { | ||
return ''; | ||
} | ||
exports.amd2cj = function(code) { | ||
return ''; | ||
} | ||
exports.cmd2cj = function(code) { | ||
return ''; | ||
} | ||
exports.amd2cmd = function(code) { | ||
return ''; | ||
} | ||
exports.cmd2amd = function(code) { | ||
return ''; | ||
} | ||
var cjsify = require('./cjsify'); | ||
var cmdify = require('./cmdify'); | ||
var amdify = require('./amdify'); | ||
var type = require('./type'); | ||
exports.type = type; | ||
exports.cjsify = function(code) { | ||
return cjsify.convert(code); | ||
}; | ||
exports.amdify = function(code) { | ||
return amdify.convert(code); | ||
}; | ||
exports.cmdify = function(code) { | ||
return cmdify.convert(code); | ||
}; |
@@ -1,35 +0,34 @@ | ||
##A converter between CommonJS and XMD(AMD/CMD) | ||
##A converter between CommonJS/AMD/CMD/other | ||
The javascript lexer bases on jssc: https://github.com/army8735/jssc | ||
[![NPM version](https://badge.fury.io/js/ranma.png)](https://npmjs.org/package/ranma) | ||
[![Build Status](https://travis-ci.org/army8735/ranma.svg?branch=master)](https://travis-ci.org/army8735/ranma) | ||
[![Coverage Status](https://coveralls.io/repos/army8735/ranma/badge.png)](https://coveralls.io/r/army8735/ranma) | ||
[![Dependency Status](https://david-dm.org/army8735/ranma.png)](https://david-dm.org/army8735/ranma) | ||
为满足所写的模块能同时运行于server环境和web环境,而不需手动修改,所以做了个转换方法,使得二者之间的模块能够互相等价转化。 | ||
原理即CommonJS模块头尾加上define,反之去掉。如果是转为AMD,还会提取依赖并解析为factory的形参。 | ||
需要注意的是AMD模块的写法应遵守文件和模块一对一的原则。AMD和CMD之间的转化同理。 | ||
为满足所写的代码能同时运行于server环境和web环境,而不需手动修改,所以做了个转换方法,使得几者之间的模块能够互相等价转化。 | ||
需要注意的是AMD模块的写法应遵守文件和模块一对一的原则。 | ||
##INSTALL | ||
```js | ||
npm install ranma | ||
``` | ||
##API | ||
##test | ||
ranma.cj2amd(code:String):String | ||
将CommonJS模块代码转换为AMD | ||
make test | ||
ranma.cj2cmd(code:String):String | ||
将CommonJS模块代码转换为CMD | ||
##API | ||
ranma.amd2cj(code:String):String | ||
将AMD模块代码转换为CommonJS | ||
ranma.cjsify(code:String):String | ||
将代码转换为CommonJS | ||
ranma.cmd2cj(code:String):String | ||
将CMD模块代码转换为CommonJS | ||
ranma.amdify(code:String):String | ||
将代码转换为AMD | ||
ranma.amd2cmd(code:String):String | ||
将AMD模块代码转换为CMD | ||
ranma.cmdify(code:String):String | ||
将代码转换为CMD | ||
ranma.cmd2amd(code:String):String | ||
将CMD模块代码转换为AMD | ||
## License | ||
# License | ||
[MIT License] |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1792114
42
49974
2
1
5
1
34
13
2
+ Addedhomunculus@0.0.19
+ Addedhomunculus@0.0.19(transitive)