
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
ranma取自同名动漫人物乱马,意指同一个事物的不同形式。
为满足所写的代码能同时运行于server环境和web环境,而不需手动修改,所以做了个转换方法,使得几者之间的模块能够互相等价转化。
需要注意的是AMD模块的写法应遵守文件和模块一对一的原则。
npm install ranma
cjsify(code:String):String
CommonJS
AMD
和CMD
,会将define的factory提取,改写return为module.exports并删除define,如果define父语句有if判断也会删除es6 module
,会将module和import变为require,export变为exports,export default变为module.exportsamdify(code:String):String
AMD
CMD
不做修改,因为AMD
兼容这种写法cmdify(code:String):String
CMD
AMD
类型,会进行依赖转化——即将factory的参数改为CMD
的require, exports, module固定参数,同时依赖变为require变量声明type.isCommonJS(code:String):Boolean
CommonJS
type.isAMD(code:String):Boolean
AMD
type.isCMD(code:String):Boolean
CMD
type.isModule(code:String):Boolean
es6 module
define.amd
的判断require, exports, module
[MIT License]
FAQs
A converter between CommonJS/AMD/CMD/other
The npm package ranma receives a total of 5 weekly downloads. As such, ranma popularity was classified as not popular.
We found that ranma demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.