Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codedotjs/unicode-escape-convert

:unicorn: Convert local and remote files containing Unicode escapes to characters!
https://github.com/codedotjs/unicode-escape-convert

characters cli-app convert emoji escapes unescape unicode

Last synced: 7 days ago
JSON representation

:unicorn: Convert local and remote files containing Unicode escapes to characters!

Awesome Lists containing this project

README

        




unicode-escape-convert






Convert local and remote files containing unicode escapes to characters!

## Install

```sh
$ npm install --global unicode-escape-convert
```
__OR__
```sh
$ sudo npm install --global unicode-escape-convert
```

## Preview



## Usage

```
Usage : uec [file/text] [arg]

Commands :

-l, --local Convert local files
-r, --remote Convert remote files
-t, --text Convert and print oneline text

Options :
--read Read the content of a local file
--save Save the local or remote file with a desirable name

NOTE : works with command --local and --remote

Files will get saved with a random name if --save is not provided!

```

## Details

- Suppose you've an unescaped unicode like `\ud83d\ude01` and you can want to convert it into the character, which is 😁. You can simply do -

```sh
$ uec -t "\ud83d\ude01"
```

Data will always be under single or double quotes!

- For locally saved file filled with unescaped unicodes. Suppose you've a file called `unicorn.txt` or `unicorn.json` and you want to convert it. Just do -

```sh
$ uec -l unicorn.txt
```

- Alternatively, you can provide `--save` flag to save the file, which can be followed by another flag as a name of the file, for example -

```sh
$uec -l unicorn.txt --save somename
```

But, by default, the files will be saved with names like `somename-unicorn.txt` or `somename-unicorn.json`.

- In case you just want to print the output without saving it as a new file, you can do the following -

```
$ uec -l unicorn.json --read
```

__`NOTE :`__ Currently, there is no support to add path of the file in order to do the conversion, `--local` command works only if the file is in same directory!

- For remote files, there is a condition - The requsted data should be in the form of `txt/json`. For the sake of testing, I've uploaded two files to check the functionality
- [`json`](https://goo.gl/19PySg)
- [`txt`](https://goo.gl/hGqMFu)

Now, to read the remote files, you can do -
```sh
$ uec -r https://goo.gl/19PySg
```
You don't need `--read` flag in order to do so. For saving the online file, You just need to -

```sh
$ uec -r https://goo.gl/19PySg --save
```

__`NOTE :`__ I just made this for personal use. I hope other find it helpful too!

## Related

- __[`unicodechar-string`](https://github.com/CodeDotJS/unicodechar-string)__ `:` `Convert unicode escapes to characters!`

## License

MIT © [Rishi Giri](rishigiri.ml)