
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
component2duo
Advanced tools
convert your component app into duo app
Duo doesn't have any concept of local components.
This tool rewrites your require paths for local components by
analyzing your root component and all your locals and scripts which are listed in your component.json files.
paths arraypaths is used.scripts property of your component.json files are analyzednpm install component2duo
var Converter = require('component2duo');
var c = new Converter('rootComponentPath', Converter.ABSOLUTE, {simulate:true});
var result = c.start();
console.log(result);
start(), default falsecomponent.jsonConverter.ABSOLUTE will rewrite require paths relative to the root component with a leading slash, for instance: /lib/local.
Converter.RELATIVE will rewrite require paths relative to each local component, for instance: ../local.
node_modules/.bin/component2duo ~/myApp/component.json 0 true
Assume you have this directory structure
myApp
├── component.json
└── lib
├── bar
│ ├── component.json
│ ├── index.js
│ └── qux.js
└── foo
├── component.json
├── index.js
├── script.js
└── sub
└── baz.js
Your root component is located at myApp/component.json with this content:
{
"name": "myApp",
"paths": ["lib"],
"locals": ["foo"]
}
myApp/foo/component.json:
{
"locals": ["bar"],
"scripts": [
"index.js",
"script.js",
"sub/baz.js"
],
"main": "index.js"
}
With component you can write require('bar') in the scripts of foo.
With this tool you can choose if you want to rewrite it into an absolute require('/lib/bar') or relative require('../bar') path.
If you checkout this project (and make a npm install) you can run:
$ ./bin/cli test/fixtures/simple/component.json 0 true
then you get this result:
lib/foo/script.js: 'bar' -> '/lib/bar'
lib/foo/script.js: 'bar/qux' -> '/lib/bar/qux'
git clone https://github.com/timaschew/component2duo.git
cd component2duo
npm install
npm test
Currently I'm not using any generator functions, but I will, so currently just ignore the build-generator directory. If you don't want use CoffeeScript you can use the build/index.js.
FAQs
convert your component project into a duo project
We found that component2duo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.