Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2tstool

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

json2tstool

transform json to typescript interface

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to json2tstool 👋

Version Documentation Maintenance

转换JSON字符串为TypeScript Interface字符串

demo 演示

json2tsDEMO

安装

npm i json2tstool

使用

In Browser

<script src="https://unpkg.com/json2tstool@1.0.0/dist/index.global.js"></script>

const jsonStr = `{ "key" : 2 }`;

json2tstool.default(jsonStr);

ES Module

import json2ts from 'json2tstool';

const jsonStr = `{ "key" : 2 }`;

json2ts(jsonStr);

NodeJS

const json2ts = require('json2tstool');

const jsonStr = `{ "key" : 2 }`;

json2ts(jsonStr);

命令行


# 输入json字符串
json2ts -i '{ "key" : 2 }'

# 指定输入文件地址
json2ts -f 'path to your json'

# 指定输出文件地址
json2ts -o 'a.ts'

支持一下

如果该库对你有帮助,可以点一下 ⭐️!

FAQs

Package last updated on 24 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc