A (very) simple CLI tool that reads JSON files and creates .d.ts files with their keys/values explicitly defined
npm install ts-json-as-const
npx ts-json-as-const [path/to/json/file.json ...]
{
"foo": {
"bar": false,
"baz": true,
"i-can": "hascheezburger"
},
"array": [ 1, 2, 3, { "foo": 1, "bar": [ 4, 5 ] }, 6 ]
}
interface Example {
foo: {
bar: false;
baz: true;
'i-can': 'hascheezburger';
},
array: [
1,
2,
3,
{
foo: 1;
bar: [
4,
5
]
},
6
]
}
declare const Example: Example;
export = Example;
👤 Bethany Hitch
- Github: @dfoverdx