Skip to content

A node.js browserify transform to enable the use of component.js components in browserify client javascript projects.

Notifications You must be signed in to change notification settings

eugeneware/decomponentify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

decomponentify

A browserify transform to enable the use of component.js components in browserify client javascript projects.

Installation

Installation is via npm:

$ npm install decomponentify

How to use.

Install some components:

# creates files in component/component-moment/
$ component install component/moment

Build out your component file into a place where you can require it from browserify:

# Builds all the components into public/scripts/vendor/component/index.js
$ component build -o public/scripts/vendor/component -n index

Require the build file in your browserify code and access the component modules by their fully qualified name (eg. 'component-moment'):

// File: public/scripts/app.js
var domready = require('domready')
  , component = require('./vendor/component')
  , moment = component('component-moment');

domready(function () {
  console.log(moment.format('dddd')); // prints "Monday"
});

Build out your browserify bundle using the decomponentify transform:

$ browserify -t decomponentify  public/scripts/app.js -o public/scripts/build/bundle.js

Then include your bundle.js in your HTML file and you're done!

About

A node.js browserify transform to enable the use of component.js components in browserify client javascript projects.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy