🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-props-to-json-ts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-props-to-json-ts

react props to json schema

1.1.5
latest
Source
npm
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

react-props-to-json-ts

React props to json schema used for form-reder

Install

yarn add react-props-to-json-ts --dev

or

npm install --save-dev react-props-to-json-ts

How to use

const propsToJSON = require('react-props-to-json-ts');
// input file path
const result = propsToJSON('filename.tsx');

console.log(result);

API

(path, handleError)

argumenttyperequireddescription
pathstringtrueThe path of parsing file
handleError(err: any) => voidfalseCallback for handle the error

Note

  • The tool will skip the prop without @title tag.
  • The component also need a @title tag, otherwise will get null.
  • If props is empty, will get a null value.

Example

pls follow the exmaple

Support types

typeformat
unionselect
numberinput number
booleancheckbox
stringinput
objectauto
arrayauto
ReactNoderichtext

Keywords

react

FAQs

Package last updated on 09 Sep 2022

Did you know?

Socket

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.

Install

Related posts