You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

flow-infer-type

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-infer-type

Generate flow type description from given object

1.2.5
latest
Source
npmnpm
Version published
Weekly downloads
10
233.33%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

About

Generate flow type from given object.

Install

npm i -g flow-infer-type

Usage

One can use with all shell scripts also programmatically. You can use to infer shape of object of any REST - like API:

curl 'https://dev.api.simpego.ch/products' --compressed | jq .[0] | node flow-infer-type

Json

echo '{"a": "ssss"}' | node flow-infer-type

Will generate valid flow(/ possibly typescript) definition

{
  a: string
}

Js Object

echo '{a: 42}' | node flow-infer-type

Will generate:

{
  a: number
}

or

Clipboard

Copy paste your object from clipboard

pbpaste | node flow-infer-type

Test

npm test

Keywords

flow

FAQs

Package last updated on 08 Jan 2018

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