Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevlened/utf8-lite
:8ball: isomorphic utf8 library in 113 bytes
https://github.com/kevlened/utf8-lite
isomorphic javascript small utf8
Last synced: about 1 month ago
JSON representation
:8ball: isomorphic utf8 library in 113 bytes
- Host: GitHub
- URL: https://github.com/kevlened/utf8-lite
- Owner: kevlened
- License: mit
- Created: 2017-12-31T17:11:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-09T06:12:39.000Z (almost 7 years ago)
- Last Synced: 2024-02-23T21:03:45.158Z (10 months ago)
- Topics: isomorphic, javascript, small, utf8
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# utf8-lite [![NPM](https://img.shields.io/npm/v/utf8-lite.svg)](https://npmjs.com/package/utf8-lite) [![Build](https://travis-ci.org/kevlened/utf8-lite.svg?branch=master)](https://travis-ci.org/kevlened/utf8-lite)
isomorphic utf8 library in 113 bytes## Install
```npm install utf8-lite```
## Usage
```javascript
const utf8 = require('utf8-lite')utf8.toUtf8('hello 你好')
// hello \xE4\xBD\xA0\xE5\xA5\xBDutf8.fromUtf8('hello \xE4\xBD\xA0\xE5\xA5\xBD')
// hello 你好
```## Can it be smaller?
If you use ES6 imports with a bundler that supports tree-shaking, yes!
```javascript
import { toUtf8 } from 'utf8-lite'
```## License
MIT