@logistics-ts/core
v0.1.1
Published
Core types, column store, data loading, and shared numerics for logistics-ts.
Readme
@logistics-ts/core
Foundational layer of logistics-ts:
canonical record types, CSV/DB-row loaders, time bucketization, shared
numerics, the Explained<T> result wrapper, and synthetic demo data. Zero
runtime dependencies.
Install
npm i @logistics-ts/coreWhat's in it
- Records:
DemandRecord,StockRecord,LeadTimeRecord, plusloadDemand/loadStock/loadLeadTimesto map arbitrary rows onto them. bucketize: turns raw demand into a dense, zero-filled per-item time series — the shape every forecasting/classification function expects.- Numerics:
mean,standardDeviation,variance,coefficientOfVariation,averageDemandInterval,inverseNormalCdf,normalCdf/normalPdf,nelderMead— hand-rolled and golden-tested against authoritative values, not a wrapped stats library. generateExampleData: a reproducible synthetic{ demand, stock, leadTimes }catalogue, for demos and tests.Explained<T>/explain(): the result-wrapper contract used across everylogistics-tspackage —{ value, method, inputs, reasoning, citations?, warnings? }.
Quick start
import { bucketize, generateExampleData, mean, standardDeviation } from '@logistics-ts/core'
const { demand } = generateExampleData({ items: 3, seed: 1 })
const series = bucketize(demand, 'month')[0]
const quantities = series.buckets.map((b) => b.quantity)
console.log(mean(quantities), standardDeviation(quantities))In the umbrella package
@logistics-ts/core is re-exported as the core namespace from
logistics-ts. Install this
scoped package directly when you only need the data model and numerics — no
forecasting, classification, or inventory logic.
