Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankwallis/decomponentify1
browserify transform to read dependencies from component.json (lets you install packages directly from github)
https://github.com/frankwallis/decomponentify1
Last synced: 10 days ago
JSON representation
browserify transform to read dependencies from component.json (lets you install packages directly from github)
- Host: GitHub
- URL: https://github.com/frankwallis/decomponentify1
- Owner: frankwallis
- Created: 2014-11-22T20:26:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-23T22:30:22.000Z (about 10 years ago)
- Last Synced: 2024-12-14T09:10:00.844Z (about 1 month ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# decomponentify1
A browserify transform to enable the easy use of [componentjs](https://github.com/component) components in browserify client javascript projects.
Shamelessly copied from [debowerify](https://github.com/eugeneware/debowerify)
[![build status](https://secure.travis-ci.org/frankwallis/decomponentify1.png)](http://travis-ci.org/frankwallis/decomponentify1)
## Installation
Installation is via npm:
```
$ npm install decomponentify1
```## How to use.
Install some components directly from github:
```
$ component install components/underscore
```Require the component file by it's component identifier (ie. in this case "underscore"):
``` js
// public/scripts/app.js
var _ = require('underscore'); // the remote component directly from github
var $ = require('jquery'); // from bower via debowerify
var domready = require('domready'); // a regular browserify npm componentdomready(function () {
var button = document.getElementById('fullscreen');
button.addEventListener('click', function (evt) {
evt.preventDefault();
var name = 'harry';
var templateData = $('#sayHello').text();
var compiled = _.template(templateData, {'data': name });
$('#helloDiv').html(compiled);
});
});
```Build out your browserify bundle using the decomponentif transform:
```
$ browserify -t decomponentify1 public/scripts/app.js -o public/scripts/build/bundle.js
```Then include your bundle.js in your HTML file and you're done!