Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sstephenson/stitch
Stitch your CommonJS modules together for the browser
https://github.com/sstephenson/stitch
Last synced: about 2 months ago
JSON representation
Stitch your CommonJS modules together for the browser
- Host: GitHub
- URL: https://github.com/sstephenson/stitch
- Owner: sstephenson
- License: mit
- Archived: true
- Created: 2010-09-18T01:20:47.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-11-02T14:08:32.000Z (about 12 years ago)
- Last Synced: 2024-09-21T15:44:56.145Z (about 2 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 280 KB
- Stars: 1,040
- Watchers: 27
- Forks: 79
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Develop and test your JavaScript applications as CommonJS modules in
Node.js. Then __Stitch__ them together to run in the browser.npm install stitch
Bundle code in lib/ and vendor/ and serve it with [Express](http://expressjs.com/):
var stitch = require('stitch');
var express = require('express');var package = stitch.createPackage({
paths: [__dirname + '/lib', __dirname + '/vendor']
});var app = express.createServer();
app.get('/application.js', package.createServer());
app.listen(3000);Or build it to a file:
var stitch = require('stitch');
var fs = require('fs');var package = stitch.createPackage({
paths: [__dirname + '/lib', __dirname + '/vendor']
});package.compile(function (err, source){
fs.writeFile('package.js', source, function (err) {
if (err) throw err;
console.log('Compiled package.js');
})
})