New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

character-sets

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

character-sets

IANA Character Sets as JSON or Array of strings from https://www.iana.org/assignments/character-sets/character-sets.xhtml

latest
Source
npmnpm
Version
1.0.8
Version published
Weekly downloads
2.1K
272.48%
Maintainers
1
Weekly downloads
 
Created
Source

Character Sets

JSON registry of IANA Character Sets.

npm version

MIT License Node 4.x.x

Install

NodeJS

  npm i -S character-sets 

HTTP

curl https://raw.githubusercontent.com/JustinBeaudry/character-sets/master/charsets.json -o charsets.json

Usage

const characterSets = require('character-sets');

// array of character sets
characterSets.toArray(); // ['UTF-8', ...]

// lower cased character set array
characterSets.normalize(); // ['utf-8', ...]

// is my character set a standardized character set?
characterSets.includes('utf-8'); // true
characterSets.includes('UTF-8'); // true
characterSets.includes('US-ASCII'); // true
characterSets.includes('us-ascii'); // true
characterSets.includes('pikachu'); // false

API

toArray(): string[]

Returns an array of IANA character set strings.

normalize(): string[]

Returns an array of lowercase IANA character set strings.

includes(charSet: string): boolean

Returns true if the character set string is included in the standardized set of IANA character set strings, otherwise returns false.

Keywords

charset

FAQs

Package last updated on 17 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts