npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-native2ascii

v0.3.0

Published

Node.js implementation of Java's Native-to-ASCII Converter

Readme

             _   _           ___                _ _ 
            | | (_)         |__ \              (_|_)
 _ __   __ _| |_ ___   _____   ) |__ _ ___  ___ _ _
| '_ \ / _` | __| \ \ / / _ \ / // _` / __|/ __| | |
| | | | (_| | |_| |\ V /  __// /| (_| \__ \ (__| | |
|_| |_|\__,_|\__|_| \_/ \___|____\__,_|___/\___|_|_|

Build Status Downloads Release License

node-native2ascii is a Node.js implementation of Java's Native-to-ASCII Converter.

Install

Install using npm:

npm install --save node-native2ascii

Or, to be able to access the native2ascii command from anywhere:

npm install --global node-native2ascii

Usage

API

native2ascii(input[, options])

Converts characters within input so that it can be encoded in ASCII by using Unicode escapes ("\uxxxx" notation) for all characters that are not part of the ASCII character set.

This can be useful when dealing with .properties files and characters that are not in the ISO-8859-1 character set.

The reverse option can be specified to reverse the conversion and instead convert Unicode escapes to their corresponding Unicode characters.

Characters within the Basic Multilingual Plane (BMP) as well as surrogate pairs for characters outside BMP are supported.

Options

| Option | Type | Default | Description | |-----------|-----------|---------|-------------------------------------| | reverse | boolean | false | Whether the reverse the conversion. |

Examples
import { native2ascii } from "node-native2ascii";

native2ascii("I ♥ Unicode!");
//=> "I \\u2665 Unicode!"
native2ascii("𠮷𠮾");
//=> "\\ud842\\udfb7\\ud842\\udfbe"

native2ascii("I \\u2665 Unicode!", { reverse: true });
//=> "I ♥ Unicode!"
native2ascii("\\ud842\\udfb7\\ud842\\udfbe", { reverse: true });
//=> "𠮷𠮾"

CLI

Usage: native2ascii [options] [input-file] [output-file]

Options:
  -e, --encoding <encoding>  specify encoding to use (default: "utf8")
  -r, --reverse              perform reverse conversion (default: false)
  -V, --version              output the version number
  -h, --help                 display help for command

Converts a file that is encoded to any character encoding that is supported by Node.js (which can be controlled via the encoding command line option) to a file encoded in ASCII, using Unicode escapes ("\uxxxx" notation) for all characters that are not part of the ASCII character set.

This can be useful when dealing with .properties files and characters that are not in the ISO-8859-1 character set.

The reverse command line option can be specified to reverse the conversion and instead convert Unicode escapes to their corresponding Unicode characters.

If the output-file command line argument is not specified, standard output is used for output. Additionally, if the input-file command line argument is not specified, standard input is used for input.

Examples

Convert a file encoded using UTF-8 into a file encoded using ASCII, Unicode escaping characters not in the ASCII character set:

# Using file command line arguments:
native2ascii utf8.properties ascii.properties
# Using STDIN and STDOUT:
cat utf8.properties | native2ascii > ascii.properties

Convert a file encoded using ASCII into a file encoded using UTF-8, unescaping any Unicode escapes:

# Using file command line arguments:
native2ascii --reverse ascii.properties utf8.properties
# Using STDIN and STDOUT:
cat ascii.properties | native2ascii --reverse > utf8.properties

Related

Bugs

If you have any problems with this package 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 all contributors can be found in AUTHORS.md.

License

Copyright © 2025 neocotic

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