Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
component-x
Advanced tools
Component package manager for building a better web.
With node previously installed:
$ npm install -g component-x
component-YOURCOMMAND
git-style--standalone
to share them with non-component(1) users#components
on freenodeVia --help
:
Usage: component-x <command> [options]
Options:
-h, --help output usage information
-V, --version output the version number
Commands:
install [name ...] install one or more components
create [dir] create a component skeleton
search [query] search with the given query
convert <file ...> convert html files to js modules
info <name> [prop] output json component information
changes <name> output changelog contents
wiki open the components list wiki page
build build the component
ls list installed components
To install one or more packages, simply pass their github
repo names as arguments to component install
. Dependencies
are resolved and the component contents are downloaded into
./components
by default. View component help install
for details.
$ component install component/tip
install : component/tip@master
dep : component/emitter@master
install : component/emitter@master
dep : component/jquery@master
install : component/jquery@master
fetch : component/tip:index.js
fetch : component/tip:tip.css
fetch : component/tip:tip.html
fetch : component/emitter:index.js
fetch : component/jquery:index.js
complete : component/emitter
complete : component/jquery
complete : component/tip
By adding your component to the Components List wiki page it will become automatically available to component-search(1)
. When invoked with no query all components are displayed, otherwise a filtered search, ordered by the number of github "stars":
$ component search ui
component/dialog
url: https://github.com/component/dialog
desc: Dialog component
★ 12
component/notification
url: https://github.com/component/notification
desc: Notification component
★ 10
component/overlay
url: https://github.com/component/overlay
desc: Overlay component
★ 7
By using GitHub as the registry, component(1)
is automatically
available to you without further explicit knowledge or work
creating a registry account etc.
A nice side-effect of this namespaced world is that dependencies are explicit and self-documenting. No longer do you need to query the registry for a "repo" property that may not exist, it's simply built in to the package name, for example "visionmedia/page.js" rather than the unclear "page".
Another benefit of this is that there are zero name collisions, for example
you may use "component/tip" for a dependency of "foo", and "someuser/tip"
as a dependency of "bar", providing require('tip')
in each. This prevents
obscure or irrelevant naming such as "progress", "progress2", "progress-bar",
"progress-component" found in npm.
The component-create(1)
command can create a component
project skeleton for you by filling out the prompts. Once
this repo is published to GitHub, you're all done!
name: popover
description: Popover UI component
does this component have js? yes
does this component have css? yes
does this component have html? yes
create : popover
create : popover/index.js
create : popover/template.html
create : popover/popover.css
create : popover/Makefile
create : popover/Readme.md
create : popover/.gitignore
create : popover/component.json
A Makefile
is created for you in order to create a build of the component,
complete with installed dependencies simply execute make
.
Because component(1)
has no notion of a "template", even simple HTML files
should be converted to a require()
-able module. It is recommended that public
components shared within the community use regular HTML templates, and regular
CSS stylesheets to maximize contributions, however if you wish to use alternate
technologies just make sure to compile them before publishing them to GitHub.
For the recommended use-case of regular HTML, the component-convert(1)
command
will translate a regular HTML file to its require()
-able JavaScript counterpart.
component(1)
and sub-commands are structured much like git(1)
,
in that sub-commands are simply separate executables. For example
$ component info pkg
and $ component-info pkg
are equivalent.
Because of this you'll likely want PATH="./bin:$PATH"
in your
profile or session while developing component, otherwise ./bin/component
will have a hard time finding the sub-commands.
component(1)
uses [~/.netrc](http://man.cx/netrc(4), like other tools such as curl and git, to specify credentials for remote hosts. Simply create a ~/.netrc
file in the home directory:
machine raw.github.com
login visionmedia
password pass123
Make sure dependencies are installed:
$ npm install
Then run:
$ make test
Open source application examples:
(The MIT License)
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
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.
FAQs
Component package manager consuming git repositories
The npm package component-x receives a total of 1 weekly downloads. As such, component-x popularity was classified as not popular.
We found that component-x 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.