An ECMAScript module to determine whether the string is ASCII.
Find a file
2026-08-10 17:58:53 +08:00
.github Update resources 2026-07-15 17:57:34 +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-08-03 13:00:35 +08:00
.npm-github.build.ts Update resources 2026-08-03 13:00:35 +08:00
.npm-kaki87.build.ts Update resources 2026-08-03 13:00:35 +08:00
.npm-npm.build.ts Update resources 2026-08-03 13:00:35 +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 2026-06-30 17:30:13 +08:00
CONTRIBUTING.md Update resources 2026-08-03 13:00:35 +08:00
control.ts Fmt 2026-01-29 17:47:49 +08:00
deno.jsonc Update resources 2026-08-10 17:58:53 +08:00
jsr.jsonc Update resources 2026-06-30 17:30:13 +08:00
LICENSE.md Update resources 2026-06-19 13:11: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-08-10 17:58:53 +08:00
SECURITY.md Update resources 2026-06-19 13:11:28 +08:00

Is String ASCII (ES)

⚖️ MIT

🔗 DistBoard @hugoalhGitHubJSRNPM

An ECMAScript module to determine whether the string is ASCII.

🎯 Runtime Targets

Any runtime which support ECMAScript should able to use this; These runtimes are officially supported:

🛡️ Runtime Permissions

This does not request any runtime permission.

#️⃣ Entrypoints

Name Path Description
. ./mod.ts Default.
./all ./all.ts All ASCII characters.
./control ./control.ts ASCII control characters.
./printable ./printable.ts ASCII printable characters.

Note

  • Different runtimes have vary support for the entrypoints, visit the runtime documentation for more information.
  • 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).

🧩 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