Install with pnpm
pnpm add @gabroberge/ts-json-as-const
Install with yarn
yarn add @gabroberge/ts-json-as-const
Install with npm
npm install --save @gabroberge/ts-json-as-const
npx ts-json-as-const [path/to/json/file.json ...]
pnpm dlx ts-json-as-const [path/to/json/file.json ...]
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}
export type Tsconfig = {
compilerOptions: {
target: 'es2016';
module: 'commonjs';
strict: true;
esModuleInterop: true;
skipLibCheck: true;
forceConsistentCasingInFileNames: true;
};
};
declare const Tsconfig: Tsconfig;
export = Tsconfig;
[
{
"name": "John",
"age": 30,
"cars": [
{
"name": "Ford",
"models": [{ "name": "Fiesta" }, { "name": "Focus" }]
},
{
"name": "BMW",
"models": [{ "name": "320" }, { "name": "X3" }]
},
{
"name": "Fiat",
"models": [{ "name": "500" }, { "name": "Panda" }]
}
]
}
]
export type Array = [
{
name: 'John';
age: 30;
cars: [
{ name: 'Ford'; models: [{ name: 'Fiesta' }, { name: 'Focus' }] },
{ name: 'BMW'; models: [{ name: '320' }, { name: 'X3' }] },
{ name: 'Fiat'; models: [{ name: '500' }, { name: 'Panda' }] },
];
},
];
declare const Array: Array;
export = Array;
👤 Gabriel Roberge
- Github: @gabroberge
👤 Bethany Hitch (Original Author)
- Github: @dfoverdx