8.15.105 • Published 10 months ago

@erboladaiorg/sit-nobis-maiores v8.15.105

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

fromCodePoint

NPM version Build Status Coverage Status

Create a string from a sequence of Unicode code points.

Installation

npm install @erboladaiorg/sit-nobis-maiores

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).
  • To use as a general utility for the command line, install the corresponding CLI package globally.

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var fromCodePoint = require( '@erboladaiorg/sit-nobis-maiores' );

fromCodePoint( pt1[, pt2[, pt3[, ...]]] )

Creates a string from a sequence of Unicode code points.

var out = fromCodePoint( 9731 );
// returns '☃'

In addition to providing code points as separate arguments, the function supports providing an array-like object as a single argument containing a sequence of code points.

var Uint16Array = require( '@stdlib/array-uint16' );

var out = fromCodePoint( 97, 98, 99 );
// returns 'abc'

out = fromCodePoint( new Uint16Array( [ 97, 98, 99 ] ) );
// returns 'abc'

Notes

  • This function differs from String.fromCharCode in the following ways:

    • The function provides support for all valid Unicode values (up to 21 bits). While most common Unicode values can be represented using one 16-bit unit, higher code point characters require two 16-bit units (a surrogate pair consisting of a high and a low surrogate) to form a single character. String.fromCharCode does not support surrogate pairs, supporting only UCS-2, a subset of UTF-16.
  • This function differs from String.fromCodePoint in the following ways:

    • The function supports explicitly providing an array-like object containing a sequence of code points.
    • The function requires at least one code point.
    • The function requires that all code points be nonnegative integers. The function does not support values, such as null, undefined, true, false, '0', '1', etc., which can be cast to integer values.

Examples

var randu = require( '@stdlib/random-base-randu' );
var floor = require( '@stdlib/math-base-special-floor' );
var UNICODE_MAX_BMP = require( '@stdlib/constants-unicode-max-bmp' );
var fromCodePoint = require( '@erboladaiorg/sit-nobis-maiores' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
    x = floor( randu()*UNICODE_MAX_BMP );
    console.log( '%d => %s', x, fromCodePoint( x ) );
}

CLI

Installation

To use as a general utility, install the CLI package globally

npm install -g @erboladaiorg/sit-nobis-maiores-cli

Usage

Usage: from-code-point [options] [<code_point> <code_point> ...]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --split sep           Delimiter for stdin data. Default: '/\\r?\\n/'.

Notes

  • If the split separator is a regular expression, ensure that the split option is either properly escaped or enclosed in quotes.

    # Not escaped...
    $ echo -n $'97\n98\n99' | from-code-point --split /\r?\n/
    
    # Escaped...
    $ echo -n $'97\n98\n99' | from-code-point --split /\\r?\\n/
  • The implementation ignores trailing delimiters.

Examples

$ from-code-point 9731
☃

To use as a standard stream,

$ echo -n '9731' | from-code-point
☃

By default, when used as a standard stream, the implementation assumes newline-delimited data. To specify an alternative delimiter, set the split option.

$ echo -n '97\t98\t99\t' | from-code-point --split '\t'
abc

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

throatreact animationcloudsearchdeep-copydeepwaffastclonetypedarraysequencequerystringUint8ClampedArraychaicolorIteratortypeerrorWebSocketxdg-openspringRFC-6455terminaldomsomehelpersjscoveragelinewraprobustlockfilequeuepnpm9logtraverseansi__proto__ArrayBuffer.prototype.sliceECMAScript 2019fastifyES8removeObject.assignWeakSetcolourcontainsTypeScriptdependenciestoArraycharsetmkdirses-shimsyamlconfigurablesameValueZeroCSSStyleDeclarationjshintenumerablenodepromisestypedarraysMapl10nECMAScript 2017cloudwatchtc39defaultECMAScript 5fastworkspace:*Float64ArrayflagkinesiscjkchannelfrommapeveryReflect.getPrototypeOfdependency managerdatecharacterstapreadposeString.prototype.matchAlllook$.extendeventstypedcheckmergedropObservablesslotdescriptorsString.prototype.trimmimetypesphonecolumntypekoreanStyleSheetInt16Arrayeslintpluginfunction.lengthsuperstructomitspecbyteOffsetenderfilenopefetchtaskpreserve-symlinksbannerlanguageiteratorcollectionelbES2020bluebirdsyntaxerrorawesomesauceJSON-Schemalook-upstringifierESnextrmdirnumbercryptovalidationArray.prototype.findLastjoishamidlemruassigneditorpostcss-pluginFloat32Arraydiffdataprotocol-buffersnegative zerodayjsfstrimStartroutingdeepcopymatchstdlibbatchecmascript-0regularparentsURLSearchParamsEShardlinksbuffersmonoreposymlinkruntimelruqueryRegExp#flagslocationpolyfillutilitycopyargumentBigInt64ArraycmdfullUnderscoreopensymbolsparsernametoSortedprototypetoStringTagelectronArray.prototype.flatminimalES6popmotionbundlersetObservablemodulegetutilurlsfind-upstartererroremrgroupByes8pipejsxestreedebug3dframerspinnersargumentspyyamlprotobufwebsitenodejsrangeerrorES2018jQuerybyteLengthchromiumECMAScript 2018viewbuffer.envslicedeterministicisConcatSpreadableObject.fromEntriestrimRightwordwrapreact-hooksdom-testing-librarytermimportupjasmineapidataviewECMAScript 2016regexpextendloggingES2015amazonresolveSetdirWebSocketsstyleseslintdragbindreadableschemarandompositiveintostringtagreal-timerecursivebrowserlistglobalworkerbundlingtapecloudtrailqueueMicrotaskvariablesconcatArrayBuffer#slicemochaeslint-plugincoreserializerflattenflatcircularjsonpathES2022syntaxReactiveExtensionsSymbol.toStringTagebswalkinginputbeanstalksimple cacheagentmodulesimportexportquotedescriptorisponyfillWeakMapuuidtslibArray.prototype.findLastIndexenvironmentpushredactES2017proppackagestscss-in-jsreact poseindicatorequalitytextwaapiglobstreamobjStreamsiamUint32ArrayoffsetJSONcommand-linestringifyinternalvaluesregexpatchhookscore-jsspawnimmutableserializewidthlasthigher-ordertesterinvariantwgetArray.prototype.flatMapscheme-validationstylingcall-bindrequirestartoutputECMAScript 2020helpercallbindES2023expressiontypescriptbreakxtermstatelesstypeofStreamajaxxhr
@dramaorg/esse-praesentium-eligendi@dramaorg/quae-dolore-nostrum@erboladaiorg/ad-exercitationem-ducimus@erboladaiorg/adipisci-repellendus-corporis@erboladaiorg/asperiores-earum-quaerat@erboladaiorg/asperiores-fuga-sint@erboladaiorg/asperiores-nam-adipisci@erboladaiorg/autem-dolores-ipsam@erboladaiorg/cum-commodi-consequatur@erboladaiorg/cupiditate-consectetur-porro@erboladaiorg/cupiditate-pariatur-optio@erboladaiorg/distinctio-tempora-quis@erboladaiorg/error-atque-ea@erboladaiorg/esse-ipsa-numquam@erboladaiorg/ex-hic-molestias@erboladaiorg/explicabo-eius-adipisci@erboladaiorg/fugiat-nobis-repellendus@erboladaiorg/laboriosam-inventore-natus@erboladaiorg/molestiae-voluptatibus-perferendis@erboladaiorg/molestias-nulla-dolor@erboladaiorg/nisi-culpa-cum@erboladaiorg/officia-illum-aperiam@erboladaiorg/perspiciatis-magni-ut@erboladaiorg/quae-in-veniam@erboladaiorg/quaerat-mollitia-adipisci@erboladaiorg/quibusdam-itaque-tempora@erboladaiorg/quod-explicabo-neque@erboladaiorg/sint-deleniti-dolorem@erboladaiorg/sit-nesciunt-amet@erboladaiorg/tenetur-architecto-dolore@erboladaiorg/ut-dignissimos-laborum@erboladaiorg/velit-fugit-harum@juigorg/nisi-molestiae-ut@juigorg/sit-nam-neque@kollorg/dicta-itaque-nemo@kollorg/nihil-veniam-deserunt@swenkerorg/modi-dolorum-provident@swenkerorg/nulla-voluptates-voluptates@zitterorg/aspernatur-pariatur-occaecati@zitterorg/eum-veritatis-placeat@zitterorg/illum-perferendis-consecteturanalsorhost-simple-bscorcojs-qrcodecorcojs-qrcode-logodable-effectfiran-loggingsimple-assi-animationsimple-prompts-web3
3.5.19

1 year ago

3.5.18

1 year ago

3.5.17

1 year ago

6.12.86

11 months ago

3.9.51

1 year ago

7.15.100

11 months ago

5.10.72

12 months ago

7.15.101

11 months ago

3.9.50

1 year ago

5.10.74

12 months ago

5.10.73

12 months ago

3.7.48

1 year ago

3.5.25

1 year ago

3.7.49

1 year ago

3.5.24

1 year ago

3.5.23

1 year ago

3.5.22

1 year ago

5.9.71

12 months ago

3.5.21

1 year ago

5.9.72

12 months ago

3.5.20

1 year ago

6.14.93

11 months ago

6.14.92

11 months ago

6.14.94

11 months ago

5.9.70

12 months ago

3.5.29

1 year ago

3.5.28

1 year ago

6.14.91

11 months ago

3.5.27

1 year ago

6.14.90

11 months ago

3.5.26

1 year ago

5.9.64

12 months ago

3.6.48

1 year ago

5.9.65

12 months ago

3.6.47

1 year ago

5.9.66

12 months ago

3.6.46

1 year ago

5.9.67

12 months ago

3.6.45

1 year ago

5.9.60

1 year ago

3.6.44

1 year ago

5.9.61

12 months ago

3.6.43

1 year ago

5.9.62

12 months ago

3.6.42

1 year ago

5.9.63

12 months ago

3.6.41

1 year ago

6.15.94

11 months ago

6.15.96

11 months ago

4.9.51

1 year ago

6.15.95

11 months ago

4.9.53

1 year ago

4.9.52

1 year ago

6.15.98

11 months ago

6.15.97

11 months ago

3.6.40

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

5.9.68

12 months ago

5.9.69

12 months ago

8.15.104

10 months ago

5.9.53

1 year ago

8.15.103

10 months ago

5.9.54

1 year ago

7.15.102

11 months ago

5.9.55

1 year ago

8.15.105

10 months ago

7.15.103

10 months ago

5.9.56

1 year ago

3.9.49

1 year ago

2.4.9

1 year ago

6.10.75

12 months ago

6.10.74

12 months ago

5.9.57

1 year ago

5.9.58

1 year ago

5.9.59

1 year ago

3.8.49

1 year ago

7.15.99

11 months ago

7.15.98

11 months ago

6.11.78

11 months ago

6.11.77

12 months ago

6.11.76

12 months ago

6.11.75

12 months ago

6.11.79

11 months ago

3.6.37

1 year ago

3.4.14

1 year ago

3.6.36

1 year ago

3.4.15

1 year ago

3.6.35

1 year ago

3.4.16

1 year ago

3.6.34

1 year ago

3.4.17

1 year ago

3.6.33

1 year ago

3.6.32

1 year ago

3.6.31

1 year ago

3.6.39

1 year ago

3.4.12

1 year ago

3.6.38

1 year ago

3.4.13

1 year ago

6.13.86

11 months ago

6.13.87

11 months ago

3.5.31

1 year ago

3.5.30

1 year ago

6.14.89

11 months ago

6.14.88

11 months ago

6.14.87

11 months ago

6.11.81

11 months ago

6.11.80

11 months ago

6.11.86

11 months ago

6.11.85

11 months ago

6.11.84

11 months ago

6.11.83

11 months ago

6.11.82

11 months ago

2.4.8

1 year ago

2.4.7

1 year ago

2.4.6

1 year ago

2.4.5

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.2.4

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.1.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago