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

ymlts

v1.1.1

Published

yaml typescript generator

Readme

YAML to Typescript Generator

Command Line Interface to generate Typescript from YAML File. Combines and simplifies quicktype and js-yaml package.

General

Typing file extension for source and target files are optional.

Install & Usage Local

Install:  npm i -D ymlts

Usage  :  npx ymlts source [target] [flags]

Install & Usage Global

Install:  npm i -g ymlts

Usage  :  ymlts source [target] [flags]

Help

  usage : ymlts source [target] [flags]

  source: source file or folder to .yaml or .yml
  target: target file or folder to .d.ts or .ts file
  flags : -t  generate .ts instead of .d.ts
          -o  make all properties optional
          -m  merge all files into one
          -s  silent mode
          -h  show help message

CLI - Example File

  Example Environment
  cwd:    /source
  files:  /file.yaml
  usage:  ymlts file

  source: /source/file.yaml
  target: /source/file.d.ts
  usage:  ymlts /usr/file -t

  source: /usr/file.yaml
  target: /usr/file.ts
  usage:  ymlts file target

  source: /source/file.yaml
  target: /source/target.d.ts
  usage:  ymlts resource/file /usr/target

  source: /source/resource/file.yaml
  target: /usr/target.d.ts

CLI - Example Folder

  Example Environment
  cwd:    /source
  files:  /file.yaml
          /subfolder/file.yaml
  usage:  ymlts source

  source: /source/file.yaml
          /source/subfolder/file.yaml         
  target: /source/file.d.ts
          /source/subfolder/file.d.ts
  usage:  ymlts /usr

  source: /usr/file.yaml
          /usr/subfolder/file.yaml         
  target: /usr/file.d.ts
          /usr/subfolder/file.d.ts
  usage:  ymlts source target -t

  source: /source/file.yaml
          /source/subfolder/file.yaml         
  target: /target/file.ts
          /target/subfolder/file.ts
  usage:  ymlts source target/file -m

  source: /source/file.yaml
          /source/subfolder/file.yaml         
  target: /target/file.d.ts

Example - Input & Output

// source.yaml

description:
  title: Average Temperature
  units: Degrees Fahrenheit
data:
  temp:
    value: 50.00
    anomaly: 1.00
// target.ts

export interface Target {
    description: Description;
    data:        Data;
}

export interface Data {
    temp: Temp;
}

export interface Temp {
    value:   number;
    anomaly: number;
}

export interface Description {
    title:      string;
    units:      string;
}
// target.d.ts

interface Target {
    description: Description;
    data:        Data;
}

interface Data {
    temp: Temp;
}

interface Temp {
    value:   number;
    anomaly: number;
}

interface Description {
    title:      string;
    units:      string;
}

Issues

Quicktype merges matching types.

// source.yaml

description:
  title: Description Title
  name: Descritpion Name
book:
  title: Book Title
  name: Book Name
// target.d.ts

interface Source {
    description: Book;
    book:        Book;
}

interface Book {
    title: string;
    name:  string;
}