Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@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
The npm package @peteradeojo/typegencli receives a total of 95 weekly downloads. As such, @peteradeojo/typegencli popularity was classified as not popular.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.