Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiminghe/koa-modularize
koa middleware for transforming commonjs file into browser module format
https://github.com/yiminghe/koa-modularize
Last synced: 9 days ago
JSON representation
koa middleware for transforming commonjs file into browser module format
- Host: GitHub
- URL: https://github.com/yiminghe/koa-modularize
- Owner: yiminghe
- Created: 2014-10-29T07:12:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-14T08:28:38.000Z (over 9 years ago)
- Last Synced: 2024-10-06T12:06:47.366Z (30 days ago)
- Language: JavaScript
- Size: 303 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
Awesome Lists containing this project
README
# koa-modularize
---koa middleware for transforming node_modules js file into browser module format and imported css path to absolute node_modules path
[![NPM version][npm-image]][npm-url]
[![gemnasium deps][gemnasium-image]][gemnasium-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url][npm-image]: http://img.shields.io/npm/v/koa-modularize.svg?style=flat-square
[npm-url]: http://npmjs.org/package/koa-modularize
[travis-image]: https://img.shields.io/travis/yiminghe/koa-modularize.svg?style=flat-square
[travis-url]: https://travis-ci.org/yiminghe/koa-modularize
[coveralls-image]: https://img.shields.io/coveralls/yiminghe/koa-modularize.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/yiminghe/koa-modularize?branch=master
[gemnasium-image]: http://img.shields.io/gemnasium/yiminghe/koa-modularize.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/yiminghe/koa-modularize
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.11-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/koa-modularize.svg?style=flat-square
[download-url]: https://npmjs.org/package/koa-modularize## Usage
```javascript
var koa = require('koa');
var modularize = require('koa-modularize');
app.use(modularize());
app.listen(8000);
```## Example
```
npm start
```open http://localhost:9999/test/test.html
## API
```javascript
GeneratorFunction modularize(dir:String, option: Object)
```### dir
file directory code belongs in. defaults to process.cwd()
### Option details
name
type
description
option.nowrap
Function
whether wrap code with define and transform package into absolute url for browser loader library
option.next
Function
request handler will call this function to judge whether yield next