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

io-one

v0.3.0

Published

io

Downloads

186

Readme

io-one

A lightweight TypeScript library for building enterprise import/export and batch-processing applications.

io-one provides the infrastructure required to generate structured files, including CSV, delimiter-separated, and fixed-length records, together with a carefully selected set of workflow utilities that eliminate repetitive code found in real production projects.

Unlike general-purpose utility libraries, io-one intentionally includes only the helper functions that are repeatedly needed when working with files, exports, logs, and batch jobs.

Examples:


Installation

npm install io-one

or

yarn add io-one

Why io-one?

In most production projects, developers eventually create a structure like this:

src
├── modules
│   ├── customer
│   ├── product
│   └── order
└── common
    ├── file.ts
    ├── date.ts
    ├── export.ts
    ├── log.ts
    └── utils.ts

After several projects, these helper functions become almost identical.

Typical examples include:

  • Creating timestamped filenames
  • Creating log filenames
  • Formatting dates
  • Creating directories
  • Scanning import/export directories
  • Escaping CSV fields
  • Reading and writing text files

Instead of rewriting these helpers in every application, io-one provides the ones that naturally belong to file-processing workflows.

The goal is not to become another utility library.

The goal is to eliminate duplicated infrastructure code while keeping the library small and focused.


Design Philosophy

io-one follows three simple principles.

1. Keep the library simple

Only include features that are commonly needed in production projects.

No unnecessary abstractions.

No framework.

No hidden magic.


2. Eliminate duplicated application code

Instead of every project implementing:

function createExportFilename(...)
function createLogFilename(...)
function createDirectory(...)
function checkFileName(...)

these common workflow utilities are already available.

Examples include:

  • getPrefix()
  • dateToString()
  • timeToString()
  • NameChecker
  • mkdirSync()

3. Focus on output

io-one is responsible for converting objects into structured files.

It intentionally does not perform:

  • SQL queries
  • Database streaming
  • Database access
  • ORM functionality

Those responsibilities belong to database-specific libraries.


Position in the Ecosystem

          SQL Server
          PostgreSQL
            Oracle
            SQLite
             MySQL
               │
               ▼
        sql-core adapters
               │
               ▼
        Application Objects
               │
               ▼
             io-one
               │
      ┌────────┴────────┐
      ▼                 ▼
 Delimiter         Fixed-Length
 Formatter          Formatter
      │                 │
      └────────┬────────┘
               ▼
             Files

io-one is the output layer of the ecosystem.

Database streaming belongs to provider libraries (such as mysql2-core) because every database driver has its own streaming implementation.


Features

  • CSV formatter
  • TSV formatter
  • Custom delimiter formatter
  • Fixed-length formatter
  • Async file reader
  • File writer
  • Log writer
  • Automatic directory creation
  • Schema-driven serialization
  • Custom field formatting
  • Batch filename utilities
  • File scanning utilities
  • Zero runtime dependencies

Read Files

import { createReader } from "io-one"

const reader = await createReader("customers.csv")

for await (const line of reader) {
    console.log(line)
}

Write Files

import { createWriteStream, FileWriter } from "io-one"

const stream = createWriteStream("./output", "customers.csv")

const writer = new FileWriter(stream)

writer.write("Hello")
writer.end()

CSV Export

import { DelimiterFormatter } from "io-one"

const formatter = new DelimiterFormatter(",", customerAttributes)

writer.write(formatter.format(customer))

Generated output

1,john,[email protected]

Fixed-Length Export

import { FixedLengthFormatter } from "io-one"

const formatter = new FixedLengthFormatter(customerAttributes)

writer.write(formatter.format(customer))

Suitable for:

  • Banking
  • Government systems
  • Legacy integrations
  • Batch interfaces

Schema-Driven Formatting

const attributes = {
    createdAt: {
        getString: value =>
            value.toISOString()
    }
}

Each field can define its own formatter.

No switch statements.

No custom formatter classes.


Generate Batch File Names

import { getPrefix, timeToString } from "io-one"

const now = new Date()

const filename = getPrefix("CUSTOMER_", now) + "_" + timeToString(now) + ".csv"

Example

CUSTOMER_20260716_143010.csv

Generate Log File Names

const logFile = getPrefix("EXPORT_", new Date()) + "_" + timeToString(new Date()) + ".log"

Output

EXPORT_20260716_143010.log

Scan Import Directory

const checker = new NameChecker("CUSTOMER_", ".csv")

const files = getFiles(fileNames, checker.check)

Useful when processing incoming batch files.


Create Directory

mkdirSync("./exports")

Creates the directory recursively if it does not already exist.


Typical Workflow

Application Objects
         │
         ▼
 DelimiterFormatter
         │
         ▼
    CSV Record
         │
         ▼
    FileWriter
         │
         ▼
   customers.csv

Typical Use Cases

  • CSV export
  • TSV export
  • Fixed-length file generation
  • Batch processing
  • ETL
  • Report generation
  • Scheduled jobs
  • Legacy system integration
  • Banking interfaces
  • Import/Export applications

API Overview

Readers

  • createReader()

Writers

  • createWriteStream()
  • FileWriter
  • LogWriter

Formatters

  • DelimiterFormatter
  • FixedLengthFormatter

Serialization

  • toDelimiter()
  • toDelimiterWithSchema()
  • toFixedLength()

File Utilities

  • mkdirSync()
  • getFiles()
  • NameChecker

Date Utilities

  • dateToString()
  • timeToString()
  • getPrefix()
  • getDate()
  • addDays()

Why io-one?

io-one is designed for developers building real production applications.

Instead of forcing every project to create its own common/utils folder, it provides a carefully selected set of workflow utilities that are repeatedly required when processing files.

The library remains intentionally small, dependency-free, and focused on structured file generation, making it an excellent foundation for enterprise import/export and batch-processing systems.


License

MIT