![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
@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 1 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.