npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tscnt-detector

v1.0.0

Published

Universal ISO container type normalization and detection helper

Readme

🛰️ TSCNT Detector

Universal ISO 6346 container type detection, standardization, and validation tool — based on real-world abbreviations, shipping codes, and TOS variants.

TSCNT Detector is a lightweight TypeScript utility and CLI tool that:

  • ✅ Converts real-world container type inputs (ref, flt, dry, high cube) into ISO 6346 codes (RC, FR, GP, HC)
  • ✅ Computes full container codes (45RC, 20GP)
  • ✅ Validates container serial numbers using ISO 6346 MOD-11
  • ✅ Retrieves container dimensions (L×W×H) and CBM
  • ✅ Supports CLI usage and programmatic access

📦 Installation

npm install tscnt-detector

For CLI usage globally:

npm install -g tscnt-detector

🔧 Programmatic Usage (TS/JS)

import { ContainerTypeHelper } from 'tscnt-detector';

const container = new ContainerTypeHelper('Reefer');

console.log(container.convertISO());      // → 'RC'
console.log(container.getFullISO('45'));  // → '45RC'
console.log(container.isHC());            // → true
console.log(container.getCBM('45'));      // → 75

🚀 CLI Usage

tscnt reefer --size=45
tscnt --containerType=flt --size=40
tscnt --containerNumber=TCLU7024574
tscnt --containerType=rc --containerNumber=MSCU1234560 --size=45

🔄 Sample Output:

🔎 Type Detected: RC
🔢 Full ISO: 45RC
📐 Dimensions: 13000×2300×2500 mm
📦 CBM: 75
🏷️ Is HC: true

🔍 Serial Detected:
  📦 Owner Code:        MSC
  🔠 Category:          U
  🔢 Serial Number:     123456
  ✅ Check Digit:       1
  🔍 Valid Check Digit: ❌ No

⚙️ CLI Options

| Flag | Description | |-----------------------|-------------------------------------------| | --size=NUM | Optional size prefix (default: 20) | | --containerType=XXX | Explicit container type input | | --containerNumber=XX| ISO 6346 container serial number |


🧠 Features

  • ✔️ Recognizes industry-standard and real-world abbreviations (FLT, REF, DC, NOR, RHC, STD, etc.)
  • ✔️ Detects ISO Type Codes: GP, HC, RC, FR, OT, PW, BU, etc.
  • ✔️ Validates container serials using ISO 6346 MOD-11
  • ✔️ Returns dimensions and CBM (cubic volume)
  • ✔️ Supports CLI and API usage
  • ✔️ Detects High Cube (HC) containers
  • ✔️ Extendable via RegEx matchers

🧪 Testing

npm run test

Runs all tests using Vitest.


📚 API Overview

new ContainerTypeHelper(rawType?: string, serial?: string)

| Method | Description | |--------------------------|-----------------------------------------------------------------------------| | .convertISO() | Returns ISO code from raw input (RC, GP, FR) | | .convertTOS() | Returns normalized form (e.g. FLT, REF) | | .getFullISO(size) | Returns full ISO code like 45RC | | .getDimensions(size) | Returns { length, width, height, cbm } object or null | | .getCBM(size) | Returns cubic volume in m³ or null | | .getISOCode(name) | Lookup ISO code from descriptive name | | .getISOCodeName(iso) | Lookup friendly name from ISO code | | .isHC() | Detects if the type is High Cube | | .getParsedCode() | Parses a container number into parts & verifies the check digit |


📦 Supported ISO Codes

| Code | Full Name | Examples / Aliases (Regex Matched) | |------|------------------------|-----------------------------------------------| | GP | General Purpose | gp, std, dry, st, dc | | HC | High Cube | hc, hq, highcube, hi-cube | | RC | Reefer | rf, ref, reefer, rhc, fhr, nor | | FR | Flat Rack | fr, flt, flat rack, rack, f/r | | OT | Open Top | ot, opentop, o-t, hard top | | TK | Tank | tk, tku, tank, iso tank | | BU | Bulk Container | bu, bk, bulkcontainer | | VT | Ventilated | vt, vc, ventilated, vented | | PW | Pallet Wide | pw, palletwide, wide pallet | | IN | Insulated | in, ins, thermal, isothermal | | HH | Half Height | hh, half-height, low box | | SD | Side Door / Open Side | sd, os, side door, open side | | UC | Uncontainerized | uc, nocntr, breakbulk, loose cargo |


📏 Sample Dimensions

| Size | Type | Length (mm) | Width | Height | CBM | |------|------|-------------|-------|--------|-----| | 20 | GP | 5898 | 2352 | 2390 | 33 | | 20 | RC | 5450 | 2260 | 2260 | 27 | | 40 | HC | 12032 | 2352 | 2690 | 76 | | 45 | RC | 13000 | 2300 | 2500 | 75 | | 40 | FR | 12192 | 2438 | 2591 | 76 |


👤 Author

Made with ❤️ by Jehad Jaghoub


📄 License

Licensed under the MIT License