Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/attrs/webmodules
Deprecated
https://github.com/attrs/webmodules
commonjs frontend
Last synced: 16 days ago
JSON representation
Deprecated
- Host: GitHub
- URL: https://github.com/attrs/webmodules
- Owner: attrs
- License: mit
- Created: 2016-04-08T16:43:15.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-26T14:46:38.000Z (about 6 years ago)
- Last Synced: 2025-01-10T20:45:45.813Z (27 days ago)
- Topics: commonjs, frontend
- Language: JavaScript
- Homepage:
- Size: 6.08 MB
- Stars: 3
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webmodules
**THIS PROJECT IS NO LONGER MAINTAINED**
[![NPM Version][npm-version]][npm-url] [![NPM Downloads][npm-total]][npm-url] [![NPM Downloads][npm-month]][npm-url] [![NPM Downloads][license]][npm-url] [![Join the chat at https://gitter.im/attrs/webmodules][gitter]][gitter-link]
[npm-version]: https://img.shields.io/npm/v/webmodules.svg?style=flat
[npm-url]: https://npmjs.org/package/webmodules
[npm-total]: https://img.shields.io/npm/dt/webmodules.svg?style=flat
[npm-month]: https://img.shields.io/npm/dm/webmodules.svg?style=flat
[license]: https://img.shields.io/npm/l/webmodules.svg?style=flat
[gitter]: https://badges.gitter.im/attrs/webmodules.svg
[gitter-link]: https://gitter.im/attrs/webmodules?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge## Install
```sh
$ npm i -g webmodules
```## Usage
```sh
$ mkdir myapp
$ cd myapp
$ npm install jquery
```- `public/index.html`
```html
```
- `public/app.js`
```javascript
var $ = require('jquery');
var sub = require('./sub.js');$(document).ready(function($) {
$('#content').html('hello, ' + sub.value);
});
```- `public/sub.js`
```javascript
exports.value = 'world';
```- launch
```sh
$ wpm up ./public
```## Programmatically
```sh
$ npm i webmodules express
```- lib/index.js
```javascript
var webmodules = require('webmodules');
var express = require('express');var app = express()
.use('/node_modules', webmodules.router())
.use('/', express.static('public'))
.listen(9000);
``````sh
$ node lib
```## Examples
- [commonjs](./examples/commonjs)
- [es2015](./examples/es2015)
- [coffee-script](./examples/coffee-script)
- [custom library](./examples/custom-libs)
- [bootstrap](./examples/bootstrap)
- [angular](./examples/angular)
- [react-dom](./examples/react-dom)
- [react-native-web](./examples/react-native-web)
- [various](./examples/various)### License
Licensed under the MIT License.
See [LICENSE](./LICENSE) for the full license text.