Skip to content

A small Javascript utility to determine a Typescript type from an ndjson stream

License

Notifications You must be signed in to change notification settings

dcousens/ndjson2ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ndjson2ts

A small Javascript utility to determine a Typescript type from an ndjson stream

Usage

$ echo '{"a":2022,"b":"hello","c":{"d":null}}' | ndjson2ts

type T = {
  a: number
  b: string
  c: {
    d: null
  }
}
$ ndjson2ts <<NDJSON
{"a":2022,"b":"hello","c":{"d":null}}
{"a":2023,"b":"world"}
{"a":2024}
NDJSON

type T = {
  a: number
  b?: string
  c?: {
    d: null
  }
}

LICENSE MIT

About

A small Javascript utility to determine a Typescript type from an ndjson stream

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published