Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/from2-encoding
Create a stream from a string or buffer, with an encoding parameter for converting strings to buffers
https://github.com/pfrazee/from2-encoding
Last synced: 14 days ago
JSON representation
Create a stream from a string or buffer, with an encoding parameter for converting strings to buffers
- Host: GitHub
- URL: https://github.com/pfrazee/from2-encoding
- Owner: pfrazee
- Created: 2016-10-31T20:53:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-31T21:20:09.000Z (about 8 years ago)
- Last Synced: 2024-10-30T15:54:38.095Z (2 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# from2-encoding
Create a stream from a string or buffer, with an encoding parameter for converting strings to buffers.
Part of the [from2](https://github.com/hughsk/from2) ecosystem.## Installation
```bash
$ npm install from2-encoding
```## Usage
```js
const from2Encoding = require('from2-encoding')from2Encoding('hello world', 'utf8').pipe(process.stdout)
from2Encoding('aGVsbG8gd29ybGQ=', 'base64').pipe(process.stdout)
from2Encoding('deadbeef', 'hex').pipe(process.stdout)
from2Encoding(Buffer.from('deadbeef', 'hex'), 'binary').pipe(process.stdout)
```## API
`from2Encoding(data, encoding)`
## License
[MIT](https://tldrlegal.com/license/mit-license)