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

component-as-module

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-as-module - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

History.md

9

lib/loader.js

@@ -192,9 +192,10 @@ var fs = require('fs')

Loader.prototype.loadComponent = function(name, partial) {
Loader.prototype.loadComponent = function(name, shortName) {
if (this.components[name]) return this.components[name]
var path = this.lookup(name)
if (!path && partial) {
if (!path && shortName && shortName != name) {
// failed to lookup by fullname (like repo-foo)
// let's try by partial name (foo)
path = this.lookup(partial)
path = this.lookup(shortName)
}

@@ -204,3 +205,3 @@

? new Loader(path, this).implicitPaths()
: this.parent && this.parent.loadComponent(name)
: this.parent && this.parent.loadComponent(name, shortName)

@@ -207,0 +208,0 @@ if (!comp) throw new Error('Failed to lookup component ' + name)

{
"name": "component-as-module",
"version": "0.0.1",
"version": "0.0.2",
"author": "Eldar Gabdullin <eldargab@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Require components from node programs as well as share them with npm community.",

@@ -48,3 +48,4 @@ # component-as-module

3) List dependencies. Because npm understands github urls you
can safely specify them in a component style:
can safely specify them in a component style. Dependencies
from npm repository (assuming they are components) are also ok.

@@ -57,3 +58,3 @@ ```json

"baz": "org/baz",
"qux": "*" // dependency from npm (assuming it is a component) is also ok.
"qux": "*"
}

@@ -79,5 +80,5 @@ }

"baz": "org/baz",
"qux": "*", // dependency from npm (assuming it is a component) is also ok.
"component-as-module": "*" // add additional component-as-module dependency
},
"qux": "*",
"component-as-module": "*"
},
"main": "node-main"

@@ -88,3 +89,3 @@ }

After that you can safely publish it to npm. It will work like any other npm module. (Just don't forget to include
`component.json` to package.)
`component.json` in a package.)

@@ -91,0 +92,0 @@ ## Why

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