Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 days 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 (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-15T07:54:06.000Z (over 5 years ago)
- Last Synced: 2024-10-05T06:52:36.221Z (about 1 month 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
[![npm version](https://img.shields.io/npm/v/modernizr-stream.svg)](https://www.npmjs.com/package/modernizr-stream)
[![Build Status](https://travis-ci.com/shinnn/modernizr-stream.svg?branch=master)](https://travis-ci.com/shinnn/modernizr-stream)
[![codecov](https://codecov.io/gh/shinnn/modernizr-stream/branch/master/graph/badge.svg)](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