Skip to main content

Built and signed on GitHub Actions

Number to String (short scale & long scale) converter

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
a month ago (0.6.1)
// deno-lint-ignore-file no-explicit-any import { parseArgs } from "jsr:/@std/cli@^1.0.6/parse-args"; import { ntoa, type Options } from "./mod.ts"; const args = parseArgs(Deno.args, { string: ["lang", "scale", "_"], boolean: ["verbose"], }); const numbers = args._ as string[]; if (numbers?.length < 1) throw new Error("Pass numbers as arguments"); const options: Options = { lang: args.lang as any, scale: args.scale as any, verbose: args.verbose, }; numbers.forEach((num) => { if (/^\d+$/.test(num)) { console.log(ntoa(num, options)); } else { console.error(`"${num}" is not a valid integer`); } });