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

config2ts

v2.5.2

Published

convert config to ts file.

Readme

config2ts

convert config to ts file.

install

run command: npm install -g config2ts

how to use

config2ts -d config -o dist -n csv.ts -a public

support type

| csv field | typescript type | | :--------: | :---------------: | | Index | string | | String | string | | Number | number | | Boolean | boolean | | Enum | type | | EnumIndex | type | | String[] | string[] | | Number[] | number[] | | Enum[] | type[] | | Ref | namespace.Record | | RefEnum | namespace.type | | RefEnum[] | namespace.type[] | | Object | type (Record) |

  • Number support Infinity and NaN
  • Enum support empty string type
  • Enum[] do not include empty string type
  • EnumIndex will generate index type, and will use Enum type to generate interface
  • Ref / RefEnum reference another csv's Record/type by id
  • Object parse key:value,key:value format, auto-infer value types (number/boolean/string), generates a dedicated type that merges all keys

assets2ts

Scan assets directory and generate an assets.ts index file with nested resource tree.

  • -a, --assets <path> set assets resource directory. default: public
  • Output file: assets.ts (alongside the merged config file)
  • Directory/filenames are converted to camelCase keys
  • type field uses file extension (lowercase), e.g. 'png', 'mp3', 'svg'
  • Directories containing 2+ files of the same extension get a dedicated type (e.g. PngAsset, Mp3Asset) and as Record<string, XxxAsset> annotation
  • Directories with ≤1 file or mixed extensions do not get a type annotation
  • Nested directories are supported (e.g. public/sub/image/)

generated example

// Auto Generated by config2ts, DO NOT EDIT

export type Mp3Asset = { path: string; type: 'mp3' };
export type PngAsset = { path: string; type: 'png' };
export type SvgAsset = { path: string; type: 'svg' };

export const ASSETS = {
    public: {
        image: {
            adjustHorizontal: {path:'public/image/adjust-horizontal.png',type:'png'},
            direction: {path:'public/image/direction.png',type:'png'}
        } satisfies Record<string, PngAsset>,
        music: {
            effect1: {path:'public/music/effect1.mp3',type:'mp3'},
            effect2: {path:'public/music/effect2.mp3',type:'mp3'}
        } satisfies Record<string, Mp3Asset>,
        singleFile: {
            effect1: {path:'public/single-file/effect1.mp3',type:'mp3'}
        }
    }
};

usage

import { ASSETS } from "./assets";

const meta = ASSETS.public.image.adjustHorizontal;
// meta.path → 'public/image/adjust-horizontal.png'
// meta.type → 'png'

Options

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -d, --dir <path>       set convert path. default: ./
    -o, --outDir <path>    set outDir path. default: ./
    -n, --name <name>      output file name. default: csv.ts
    -a, --assets <path>    set assets resource directory for asset index. default: public

supported file formats

| format | extension | | :----: | :-------: | | csv | .csv | | ini | .ini | | toml | .toml |