
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
react-to-typescript-definitions
Advanced tools
Create typescript definitions files (d.ts) from react components
Create typescript definitions files (d.ts) from react components.
Install as npm package:
npm install react-to-typescript-definitions --save-dev
or
npm install -g react-to-typescript-definitions
Usage
$ react2dts [--module-name <name> | --top-level-module]
react2dts reads from stdin to process a file.
Options
--module-name, --name name of the module to create
--top-level-module if the created module should live in top-level
Examples
$ cat <some/react/component.jsx> |react2dts --module-name module-name
$ cat <some/react/component.jsx> |react2dts --top-level-module
Functions:
/**
* Returns the typescript definition for the given file.
*
* @param name The name of the generated module
* @param path The path to the file to parse
* @param options The options to use
* @return The type definition as string
*/
function generateFromFile(name, path, options)
/**
* Returns the typescript definition for the given source.
*
* @param name The name of the generated module
* @param code The code to parse
* @param options The options to use
* @return The type definition as string
*/
function generateFromSource(name, code, options)
/**
* Returns the typescript definition for the given babylon AST object.
*
* @param name The name of the generated module
* @param ast The babylon ASt to parse
* @param options The options to use
* @return The type definition as string
*/
function generateFromAst(name, ast, options)
Options:
FAQs
Create typescript definitions files (d.ts) from react components
The npm package react-to-typescript-definitions receives a total of 2,257 weekly downloads. As such, react-to-typescript-definitions popularity was classified as popular.
We found that react-to-typescript-definitions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.