Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

string.fromcodepoint

mathiasbynens4.1mMIT1.0.3

A robust & optimized String.fromCodePoint polyfill, based on the ECMAScript 6 specification.

string, unicode, es6, ecmascript, polyfill

readme

ES6 String.fromCodePoint polyfill string.fromcodepoint on npm

An robust & optimized polyfill for the String.fromCodePoint method in ECMAScript 6.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Other polyfills for String.fromCodePoint are available:

Installation

Via npm:

npm install string.fromcodepoint

Then, in Node.js:

var fromCodePoint = require('string.fromcodepoint');

In a browser:

<script src="https://bundle.run/string.fromcodepoint"></script>

NOTE: It's recommended that you install this module using a package manager such as npm, because loading multiple polyfills from a CDN (such as bundle.run) will lead to duplicated code.

Notes

A polyfill + test suite for String.prototype.codePointAt is available, too.

The tests for this repository are now used by Mozilla, to help ensure their native String.fromCodePoint implementation is correct.

For maintainers

How to publish a new release

  1. On the main branch, bump the version number in package.json:

     npm version patch

    Instead of patch, use minor or major as needed.

    Note that this produces a Git commit + tag.

  2. Push the release commit and tag:

     git push && git push --tags

    Our CI then automatically publishes the new release to npm.

Author

twitter/mathias
Mathias Bynens

License

This polyfill is available under the MIT license.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.3 - 2024-02-05

Commits

  • [Deps] update call-bind, define-properties, es-abstract, get-intrinsic de770f7
  • [Dev Deps] update aud, npmignore, tape dcfc09a
  • [meta] add missing engines.node 7821acd
  • [Refactor] use es-errors, so things that only need those do not need get-intrinsic de71c86

v1.0.2 - 2023-08-26

Commits

  • [Deps] update es-abstract, get-intrinsic b62cdbe
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape 7402a9b

v1.0.1 - 2023-05-03

Commits

  • [eslint] add eslint 407e79f
  • [meta] add auto-changelog fe2a285
  • [Tests] migrate from travis to github actions 8f2a411
  • Set up automated npm publish 98f9153
  • [Refactor] use call-bind instead of function-bind; update es-abstract usage 6c2e3fc
  • [Tests] switch to nyc for coverage 6e50781
  • [Tests] add coverage cf62429
  • [meta] use npmignore to autogenerate an npmignore file f44a07b
  • [Dev Deps] update @es-shims/api, functions-have-names, tape 4e12eb2
  • [Fix] exports references nonexistent getPolyfill; add polyfill d5302af
  • [Deps] update define-properties, es-abstract 796ebf4
  • [Tests] increase coverage 6fcbdf9
  • [meta] release message is preconfigured dca5491
  • [Tests] add missing posttest 6c60518

v1.0.0 - 2020-05-21

Merged

  • [breaking] Implement the es-shim-api interface #5

Commits

  • Use tape in tests and run them on every Node.js version ffa1982
  • Use HTTPS URLs where possible 880fb77
  • Update readme 83e00ac
  • Set up Coveralls 0c77f92
  • Update repo config files 2832638
  • Test that it respects the es-shim-api interface 34e9060
  • Add missing Istanbul devDependency 54fdd4d

v0.2.1 - 2014-07-15

Commits

  • Tag the v0.2.1 release c2c8570
  • Make String.fromCodePoint.length equal 1 as per the latest draft 64774a2
  • Add some tests that were suggested by @arv 396674f

v0.2.0 - 2014-04-10

Fixed

  • Avoid RangeErrors due to maximum call stack size #1

Commits

  • Simplify tests 177fc9f
  • Make the fromCodePoint property non-enumerable d635a7c
  • Add a few tests d3098dc
  • Avoid IE8’s broken Object.defineProperty 23ee503
  • Tag the v0.2.0 release 2a010ab
  • README: Explicitly request SVG badges 31b41b3
  • Add some more tests dd1ca34
  • README: Add link to String.prototype.codePointAt polyfill 7dc1b58
  • Add test for -0 02764aa
  • README: Tweak require instructions 57bc578
  • README: Mention Mozilla 02c8ae5
  • README: Update link to ES6 draft 579503e
  • README: Update link a018a18
  • README: Link to @paulmillr’s es6-shim 5034e15

v0.1.0 - 2013-09-20

Commits

  • Initial commit 3976b0f
  • Add MIT license 9ebc636
  • Rename codePoints into codeUnits as that’s more accurate 7d205c2
  • README: Add build status badge 600e00d
  • README: Tweak description 35256b6
  • Add header comment 82b9e22