Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allnulled/utf8izer
Encode files from CLI or API, comfortably.
https://github.com/allnulled/utf8izer
Last synced: 1 day ago
JSON representation
Encode files from CLI or API, comfortably.
- Host: GitHub
- URL: https://github.com/allnulled/utf8izer
- Owner: allnulled
- Created: 2020-01-28T12:21:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-28T19:55:08.000Z (almost 5 years ago)
- Last Synced: 2024-03-25T14:45:13.078Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 187 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# utf8izer
![](https://img.shields.io/badge/version-1.0.1-green.svg) ![](https://img.shields.io/badge/tests-passing-green.svg) ![](https://img.shields.io/badge/coverage-no-red.svg)
Encode files from CLI or API, comfortably.
[![NPM](https://nodei.co/npm/utf8izer.png?stars&downloads)](https://www.npmjs.com/package/utf8izer)
## Installation
`$ npm i -g utf8izer`
## Usage
There is an **API** and a **CLI** available for `utf8izer`.
### CLI usage
Pass the files and, optionally, the original and final encodings:
```bash
utf8izer --from ascii --to utf8 file1.csv file2.txt file3.data
```After this, a small report will be given by console.
### API usage
Import the module:
```js
const Utf8izer = require("utf8izer");
```Use the main class:
```js
Utf8izer.convertFiles(["file1.csv", "file2.txt", "file3.data"], {
from: "ascii",
to: "utf8"
}).then(function(info) {
if(info.errors.length) {
return console.log("Errors on UTF8 file conversions:", info.errors);
}
});
```You do not need to catch the promise, as it will never be thrown.
## Issues
Report the issues you found at the `issues` tab of the project.
## License
This project is licensed under [WTFPL (do What The Fuck you want Public License)](https://en.wikipedia.org/wiki/WTFPL), so simple.