Skip to main content
Home

Built and signed on GitHub Actions

Define Types of COBOL.

This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
10 months ago (1.1.1)

COBOL.js

Define Types of COBOL.

Install

Published on JSR.

# Deno
deno add jsr:@askua/cobol

# npm
npx jsr add @askua/cobol

Usage

import { SIGNED_NUMBER, UNSIGNED_NUMBER } from "@askua/cobol";

const a = SIGNED_NUMBER.parse("0000000A").as(); // 1
const b = SIGNED_NUMBER.parse("0000010{").as(); // 100

console.log(SIGNED_NUMBER(a - b).toString(8)); // "0000009R"
console.log(UNSIGNED_NUMBER(a - b).toString(8)); // "00000099"

Benchmark

$ deno bench
Check file:///COBOL.js/mod_bench.ts
    CPU | Apple M2
Runtime | Deno 2.1.9 (aarch64-apple-darwin)

file:///COBOL.js/mod_bench.ts

benchmark                  time/iter (avg)        iter/s      (min … max)           p75      p99     p995
-------------------------- ----------------------------- --------------------- --------------------------
Dynamic import                      1.2 µs       843,200 (  1.2 µs …   1.3 µs)   1.2 µs   1.3 µs   1.3 µs
SIGNED_NUMBER.parse                83.7 ns    11,950,000 ( 75.1 ns …  90.5 ns)  85.3 ns  88.5 ns  89.6 ns
SIGNED_NUMBER.toString             85.1 ns    11,750,000 ( 73.4 ns … 110.2 ns)  87.1 ns 101.8 ns 104.6 ns
UNSIGNED_NUMBER.parse               9.9 ns   100,800,000 (  8.4 ns …  18.3 ns)   9.7 ns  14.6 ns  14.8 ns
UNSIGNED_NUMBER.toString           38.5 ns    26,000,000 ( 34.4 ns …  48.2 ns)  41.4 ns  43.8 ns  44.3 ns
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@askua/cobol

Import symbol

import * as cobol from "@askua/cobol";
or

Import directly with a jsr specifier

import * as cobol from "jsr:@askua/cobol";

Add Package

pnpm i jsr:@askua/cobol
or (using pnpm 10.8 or older)
pnpm dlx jsr add @askua/cobol

Import symbol

import * as cobol from "@askua/cobol";

Add Package

yarn add jsr:@askua/cobol
or (using Yarn 4.8 or older)
yarn dlx jsr add @askua/cobol

Import symbol

import * as cobol from "@askua/cobol";

Add Package

vlt install jsr:@askua/cobol

Import symbol

import * as cobol from "@askua/cobol";

Add Package

npx jsr add @askua/cobol

Import symbol

import * as cobol from "@askua/cobol";

Add Package

bunx jsr add @askua/cobol

Import symbol

import * as cobol from "@askua/cobol";