https://github.com/shinnn/modernizr-stream
Create a readable stream that emits Modernizr code
https://github.com/shinnn/modernizr-stream
browser-support code-generator feature-detection modernizr nodejs polyfill stream
Last synced: about 2 months ago
JSON representation
Create a readable stream that emits Modernizr code
- Host: GitHub
- URL: https://github.com/shinnn/modernizr-stream
- Owner: shinnn
- License: isc
- Created: 2016-02-04T10:22:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-15T07:54:06.000Z (almost 7 years ago)
- Last Synced: 2025-08-20T00:29:37.845Z (10 months ago)
- Topics: browser-support, code-generator, feature-detection, modernizr, nodejs, polyfill, stream
- Language: JavaScript
- Homepage: https://modernizr.com/
- Size: 80.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modernizr-stream
[](https://www.npmjs.com/package/modernizr-stream)
[](https://travis-ci.com/shinnn/modernizr-stream)
[](https://codecov.io/gh/shinnn/modernizr-stream)
Create a [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that emits [Modernizr](https://modernizr.com/) code
```javascript
const modernizrStream = require('modernizr-stream');
modernizrStream().pipe(process.stdout);
/*!
* modernizr v3.6.0
* Build https://modernizr.com/download?--dontmin
...
*/
```
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install modernizr-stream
```
## API
```javascript
const modernizrStream = require('modernizr-stream');
```
### modernizrStream([*options*])
*options*: `Object`
Return: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable_1)
It returns a readable stream that emits JavaScript code built with the [Modernizr code generator](https://www.npmjs.com/package/modernizr#building).
#### Options
All options of [`modernizr.build`](https://github.com/Modernizr/Modernizr#building) and [`stream.Readable`](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) are available.
```javascript
modernizrStream().on('data', data => {
data.length; //=> 5497
});
modernizrStream({minify: true}).on('data', data => {
data.length; //=> 1165
});
```
## License
[ISC License](./LICENSE) © 2018 - 2019 Shinnosuke Watanabe