Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
zettca/ntoaNumber to String (short scale & long scale) converter
This package works with Cloudflare Workers, Node.js, Deno, Bun, 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`); } });