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

@lemon-samovar/sc-tool

v1.0.0

Published

A utility to easily operate shipping container data

Readme

Node.js Package npm

sc-tool (shipping container tool)

sc-tool is the utility to easily operate shipping container data.

Table of Contents

Installation

npm install @lemon-samovar/sc-tool

or

npm install -g @lemon-samovar/sc-tool

if you will use package as a global cli command

Usage

Package:

import { Container } from '@lemon-samovar/sc-tool';

const container = new Container({
    format: "full",
    ownerCode: "MSCU",
    serialNumber: 1234560,
    typeCode: "22K2"
});
const ownerInfo = container.ownerInfo();
const typeInfo = container.typeInfo();
console.log(ownerInfo);
console.log(typeInfo);

Output:

{
  code: 'MSCU',
  company: 'MSC- MEDITERRANEAN SHIPPING COMPANY S.A.',
  city: 'GENEVE',
  country: 'Switzerland'
}
{
  category: 'Freigth container',
  type: 'Pressurised tank container (liquids and gases) — liquid tank dangerous goods > 265 kPa and ≤ 1000 kPa pressure',
  width: '6068 mm (20 ft)',
  length: '2438 mm (8 ft)',
  height: '2591 mm (8,5 ft)'
}

CLI:

$ sc-tool owner CICU1234560

> CICU1234567

code: CICU
company: CIMC CONTAINERS HOLDING COMPANY LTD
city: GUANGDONG
country: China

$ sc-tool type 22G1

> 22G1

type: General purpose container without ventilation — passive vents at upper part of cargo space
length: 2438 mm (8 ft)
height: 2591 mm (8,5 ft)
width: 6068 mm (20 ft)

API

Container

// ESM
import { Container } from '@lemon-samovar/sc-tool';
// CommonJS
const { Container } = require('@lemon-samovar/sc-tool');

new Container(data: ContainerData)

Creates a container instance from ContainerData type.

type ContainerData =
    | string
    | FullContainerData
    | ShortContainerData

interface FullContainerData {
    format: "full",
    ownerCode: string,
    serialNumber: number | string, 
    checkDigit?: number | string,
    typeCode?: string,
}

interface ShortContainerData {
    format: "short",
    containerNumber: string,
    checkDigit?: number | string,
    typeCode?: string
}

If check-digit is not provided, it will be calculated from the serial number and owner's bic-code. Example:

const cont = new Container("ABCU123456");
console.log(`Calculated check-digit: ${cont.checkDigit}`);
Calculated check-digit: 0

container.getContainerNumber(): string

Returns full container number.

Example:

const containerNumber = container.getContainerNumber();
console.log(`Full container number: ${containerNumber}`);
Full container number: ABCU1234560

container.getFullMarking(): ContainerInfo

Returns all avaliable container markings.

interface ContainerInfo {
    ownerCode: string;
    serialNumber: string;
    checkDigit: number;
    typeCode: string;
}

Example:

const cont = new Container({
  format: "short",
  containerNumber: "ABCU123456",
  typeCode: "22K2"
});
const result = cont.getFullMarking();
console.log(result);
{
  ownerCode: 'ABCU',
  serialNumber: '123456',
  checkDigit: 0,
  typeCode: '22K2'
}

container.getTypeInfo(): ContainerDataType | null

Returns container type information by type code and category identifier. Returns null if type code is not provided.

interface ContainerTypeData {
    category: string, 
    type: string, 
    width: string, 
    length: string, 
    height: string
}

Example:

const cont = new Container({
  format: "full",
  ownerCode: "RKNU",
  serialNumber: "1234560",
  typeCode: "45R1"
});
const info = cont.getTypeInfo();
console.log(info);
{
  category: 'Freigth container',
  type: 'Thermal container — mechanically refrigerated and heated',
  width: '12192 mm (40 ft)',
  length: '2438 mm (8 ft)',
  height: '2895 mm (9,5 ft)'
}

container.getOwnerInfo(): ContainerOwnerData | null

Returns information about the owner of the container by owner's bic-code. Returns null if owner's bic-code is not provided or was not found.

interface ContainerOwnerData {
    code: string,
    company: string,
    city: string,
    country: string
}

Example:

const cont = new Container("FCCU1234560");
const info = cont.getOwnerInfo();
console.log(info);
{
  code: 'FCCU',
  company: 'FAR EASTERN SHIPPING PLC',
  city: 'VLADIVOSTOK',
  country: 'Russian Federation'
}

container.ownerCode: string

A container owner's bic-code. The field is read-only.

container.serialNumber: string

A container serial number. The field is read-only.

container.checkDigit: number

A container number check-digit. Auto-calculated in Container class constructor by owner's bic-code and container serial number. The field is read-only.

container.typeCode: string

A container type code. An empty string if the type code is not provided. The field is read-only.

Validator

// ESM
import { Validator } from '@lemon-samovar/sc-tool';
// CommonJS
const { Validator } = require('@lemon-samovar/sc-tool');

Validator.calculate(ownerCode: string, serialNumber: string | number): number

Calculates check-digit by bic-code and container serial number. The method is static.

Example:

const checkDigit = Validator.calculate("ABCU", "894512");
console.log(`Calculated check-digit: ${checkDigit}`);
Calculated check-digit: 8

Validator.validate(ownerCode: string, serialNumber: string | number, checkDigit: number): boolean

Validates a container number check-digit by bic-code and container serial number. The method is static.

Example:

const checkDigit = Validator.calculate("ABCU", 894512);
const falseCheckDigit = 7;

const isValid = Validator.validate("ABCU", 894512, falseCheckDigit);

console.log(isValid);
console.log(`Given check-digit: ${falseCheckDigit}`)
console.log(`Correct check-digit: ${checkDigit}`)
false
Given check-digit: 7
Correct check-digit: 8

CLI

sc-tool may also be used as a cli tool:

$ sc-tool
Usage: sc-tool [options] [command]

A utility to easily operate shipping container data

Options:
  -V, --version                output the version number
  -h, --help                   display help for command

Commands:
  validate <container-number>  Validate check-digit of a container number
  type [options] <type-code>   Get type information
  owner <container-number>     Get container owner
  help [command]               display help for command

validate

Validates check-digit of a container number.

Example:

$ sc-tool validate ABCU1234560

✔ Container number ABCU1234560 is valid!
            
$ sc-tool validate ABCU1234569

✘ Container number ABCU1234569 is not valid! Correct check-digit is 0
  

type

Returns container type information by type code. May also return a container category by category identifier if container number is provided. To pass it, use --container-number or -n flag.

Example:

$ sc-tool type 22T2

> 22T2

type: Tank container — nondangerous liquids, minimum pressure 265 kPa
length: 2438 mm (8 ft)
height: 2591 mm (8,5 ft)
width: 6068 mm (20 ft)
          
$ sc-tool type -n ABCU123456 22G2

> ABCU123456 22G2

category: Freigth container
type: General purpose container without ventilation — opening(s) at one or both ends + "full" opening(s) on one or both sides
length: 2438 mm (8 ft)
height: 2591 mm (8,5 ft)
width: 6068 mm (20 ft)
                  

owner

Returns owner information by container number.

Example:

$ sc-tool owner RKNU1234560

> RKNU1234560

code: RKNU
company: ROKONORD LTD
city: SAINT PETERSBOURG
country: Russian Federation
     

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Apache License 2.0