Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@peteradeojo/typegencli
Advanced tools
TypegenCLI is a cli tool that helps developers generate typescript types from JSON data. This is especially useful for generating types for API responses in development
Readme
TypegenCLI is a cli tool that helps developers generate typescript types from JSON data. This is especially useful for generating types for API responses in development
Install the Typegen Server globally to use the cli
$ npm i -g @peteradeojo/typegencli
Then run
$ typegen -h
Start the listener in a terminal window
$ typegen -l/--listen [PORT]
Install the @peteradeojo/typegencli
inn your project
$ npm i @peteradeojo/typegencli
Create a generator
const {sendData} = require('@peteradeojo/typegencli');
const generator = sendData(3000); // 3000 is the port the listener is running on. This should match the port given for the -l/--listen options
Pass a type name and the JSON object you want to generate types for into the generator function
// ...
generator("Cat", data); // data can object from API response or parsed JSON. Any object at all will do
// ...
This will generate a type and output it to the listener terminal window
type Cat = {
id: number;
color: string;
picture: string;
}
It would also output to a typegen/Cat.ts
file in your project directory
Watch the demo
FAQs
TypegenCLI is a cli tool that helps developers generate typescript types from JSON data. This is especially useful for generating types for API responses in development
We found that @peteradeojo/typegencli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).