An ECMAScript module to determine whether the string is ASCII.
| .github | ||
| .codeql.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .npm-codeberg.build.ts | ||
| .npm-github.build.ts | ||
| .npm-kaki87.build.ts | ||
| .npm-npm.build.ts | ||
| .yamllint.yml | ||
| all.ts | ||
| CITATION.cff | ||
| CONTRIBUTING.md | ||
| control.ts | ||
| deno.jsonc | ||
| jsr.jsonc | ||
| LICENSE.md | ||
| mod.test.ts | ||
| mod.ts | ||
| printable.ts | ||
| README.md | ||
| SECURITY.md | ||
Is String ASCII (ES)
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
- For the full or prettier documentation, can visit via:
✍️ Examples
-
isStringASCII("日本語"); //=> false -
isStringASCII("👀"); //=> false -
isStringASCII("Hello, world!"); //=> true -
isStringASCII(""); //=> true