1. unescape-unicode
Converts Unicode escapes
unescape-unicode
Package: unescape-unicode
Created by: neocotic
Last modified: Sun, 22 May 2022 18:07:20 GMT
Version: 0.2.0
License: MIT
Downloads: 2,269
Repository: https://github.com/neocotic/unescape-unicode

Install

npm install unescape-unicode
yarn add unescape-unicode

unescape-unicode

Build Status
Coverage
Dev Dependency Status
License
Release

unescape-unicode is a Node.js library that can
convert a Unicode escape ("\uxxxx" notation) into its corresponding Unicode character.

Install

Install using npm:

 $ npm install --save unescape-unicode

You'll need to have at least Node.js 8 or newer.

API

unescapeUnicode(input[, start])

Converts the Unicode escape within input.

The Unicode escape must be valid, although it can just contain hexadecimal segment. That is, it has to match the
following pattern:

(\\u)?[0-9A-Fa-f]{4}

An error will be thrown if no valid Unicode escape is found.

Optionally, a start index can be provided to begin conversion at a specific location within input. If start is not
specified, null, or negative, the conversion will begin at the start of input.

Examples

 const unescapeUnicode = require('unescape-unicode');

unescapeUnicode('\\u2665');
//=> "♥"
unescapeUnicode('2665');
//=> "♥"
unescapeUnicode('I \\u2665 Unicode!', 2);
//=> "♥"
unescapeUnicode('\\u03bb');
//=> "λ"
unescapeUnicode('03BB');
//=> "λ"

Bugs

If you have any problems with this library or would like to see changes currently in development you can do so
here.

Contributors

If you want to contribute, you're a legend! Information on how you can do so can be found in
CONTRIBUTING.md. We want your suggestions
and pull requests!

A list of contributors can be found in
AUTHORS.md.

License

Copyright © 2018 Alasdair Mercer

See LICENSE.md for more information on our MIT
license.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin