Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ranma

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ranma - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.coveralls.yml

44

package.json
{
"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"
}
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc