An ECMAScript module to determine whether the string is ASCII.
Find a file
2026-05-09 18:05:33 +08:00
.github Update resources 2026-04-21 17:55:42 +08:00
.codeql.yml Update resources 2025-08-26 17:42:03 +08:00
.gitattributes Initial 2024-03-13 16:15:13 +08:00
.gitignore Update resources 2026-04-21 17:45:52 +08:00
.npm-codeberg.build.ts Update resources 2026-05-07 18:25:49 +08:00
.npm-github.build.ts Update resources 2026-05-07 18:25:49 +08:00
.npm-kaki87.build.ts Update resources 2026-05-07 18:25:49 +08:00
.npm-npm.build.ts Update resources 2026-05-07 18:25:49 +08:00
.yamllint.yml Initial 2024-03-13 16:15:13 +08:00
all.ts Fmt 2026-01-29 17:47:49 +08:00
CITATION.cff Update resources 2025-04-23 16:50:21 +08:00
CONTRIBUTING.md Update resources 2024-10-25 17:41:55 +08:00
control.ts Fmt 2026-01-29 17:47:49 +08:00
deno.jsonc Update resources 2026-05-07 18:25:49 +08:00
jsr.jsonc Update resources 2026-04-23 17:13:58 +08:00
LICENSE.md Update resources 2025-01-27 12:47:28 +08:00
mod.test.ts Update test 2025-09-01 17:18:38 +08:00
mod.ts Update resources 2024-10-18 17:33:01 +08:00
printable.ts Update resources 2024-05-04 15:26:20 +08:00
README.md Update resources 2026-05-09 18:05:33 +08:00
SECURITY.md Update resources 2026-05-09 18:05:33 +08:00

Is String ASCII (ES)

⚖️ MIT

🔗 GitHubJSRNPM

An ECMAScript module to determine whether the string is ASCII.

🎯 Targets

Runtime \ Source GitHub Raw JSR NPM
Bun >= v1.1.0 ✔️ ✔️
Deno >= v2.1.0 ✔️ ✔️ ✔️
NodeJS >= v20.9.0 ✔️ ✔️

🛡️ Runtime Permissions

This does not request any runtime permission.

#️⃣ Sources

  • GitHub Raw
    https://raw.githubusercontent.com/hugoalh/is-string-ascii-es/{Tag}/mod.ts
    
  • JSR
    jsr:@hugoalh/is-string-ascii[@{Tag}]
    
  • NPM
    npm:@hugoalh/is-string-ascii[@{Tag}]
    

Note

  • It is recommended to include tag for immutability.
  • These are not part of the public APIs hence should not be used:
    • Benchmark/Test file (e.g.: example.bench.ts, example.test.ts).
    • Entrypoint name or path include any underscore prefix (e.g.: _example.ts, foo/_example.ts).
    • Identifier/Namespace/Symbol include any underscore prefix (e.g.: _example, Foo._example).

⤵️ Entrypoints

Name Path Description
. ./mod.ts Default.

🧩 APIs

  • function isStringASCII(item: string): boolean;
    
  • function isStringASCIIControl(item: string): boolean;
    
  • function isStringASCIIPrintable(item: string): boolean;
    

Note

✍️ Examples

  • isStringASCII("日本語");
    //=> false
    
  • isStringASCII("👀");
    //=> false
    
  • isStringASCII("Hello, world!");
    //=> true
    
  • isStringASCII("");
    //=> true