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

cloud

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloud

Components

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-73.68%
Maintainers
1
Weekly downloads
 
Created
Source

Component

description..

What is a component?

A component provides true modularity of all units that comprise a web application. Components may be as small or large as you see fit, and are npm-installable modules like any other in node, and thus dependencies are resolved for you, promoting smaller re-usable scripts.

JavaScript

Currently all components with client-side JavaScript use file-scoping, as they are wrapped with a function exposing them to a common-js require() system similar to node's.

The declarative nature of components means that in the future we could dynamically serve components after a page has loaded, backed by something like requirejs or similar.

Example component

A component may be JavaScript, CSS, images, server-side scripts, or any combination necessary. The following is the simplest possible component, consisting of a single script jquery.

{
  "name": "jquery",
  "description": "The jQuery library",
  "version": "0.0.1"
  "component": {
    "scripts": {
      "jquery": "build/jquery.js"
    }
  }
}

Once served with component jquery would be available to the client:

var $ = require('jquery');

Stylesheets

Stylesheets ideally should contain only structural styling, leaving opinionated colors and design to the host application.

Polyfills

Components should not directly depend on polyfills. For example you should assume JSON.parse() is available, the host application may choose to conditionally load a polyfill if desired.

Future

Specs...

FAQs

Package last updated on 15 Jun 2012

Did you know?

Socket

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.

Install

Related posts

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