Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kazu69/rollup-plugin-convert-encoding
Rollup plugin to file encode
https://github.com/kazu69/rollup-plugin-convert-encoding
encoding rollup-plugin
Last synced: 19 days ago
JSON representation
Rollup plugin to file encode
- Host: GitHub
- URL: https://github.com/kazu69/rollup-plugin-convert-encoding
- Owner: kazu69
- License: mit
- Created: 2017-10-08T08:13:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-01T23:45:45.000Z (over 6 years ago)
- Last Synced: 2024-10-17T13:46:38.683Z (20 days ago)
- Topics: encoding, rollup-plugin
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/rollup-plugin-convert-encoding
- Size: 52.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rollup Convert Encoding Plugin
[![Build Status](https://travis-ci.org/kazu69/rollup-plugin-convert-encoding.svg?branch=master)](https://travis-ci.org/kazu69/rollup-plugin-convert-encoding)
This Rollup plugin converts file encoding.
## Usage
### Install
```sh
npm install rollup-plugin-convert-encode
```### Setup
example for `rollup.config.js`
```js
import encode from 'rollup-plugin-convert-encoding';
const dist = 'dist/converted.js';const options = {
dist: dist,
encodingFrom: 'EUC-JP',
encodingTo: 'SHIFT_JIS'
}
export default {
input: 'example/index.js',
plugins: [ encode(options) ],
output: [
{
format: 'cjs',
file: dist
}
]
};
```## Options
#### dist
Type: string
Default: nullFile output destination.
#### encodingFrom
Type: string
Default: utf8Original file encoding.
#### encodingTo
Type: string
Default: utf8Output file encoding.
#### iconv
Type: object
Default: {decode: {}, encode: {}}[iconv-lite](https://github.com/ashtuchkin/iconv-lite#bom-handling) BOM Handling option.
## About encodings
The plugin uses [iconv-lite](https://github.com/ashtuchkin/iconv-lite/) to handle the encoding.
Support encodings listed on the [iconv-lite page](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).## License
[MIT License](https://github.com/kazu69/rollup-plugin-convert-encoding/blob/master/LICENSE)