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

discovery-tsd

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discovery-tsd

Generates TypeScript declaration files from Google's Discovery API

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

discovery-tsd

Generate TypeScript types from Google's Discovery API

Install

$ npm install discovery-tsd

CLI

$ dtsd bigquery v2 > bigquery.d.ts

API

createTypes(api, version, [options])

const createTypes = require('discovery-tsd');
const fs = require('fs');
const {promisify} = require('util');

const writeFile = promisify(fs.writeFile);

async function getTypes() {
  const types = await createTypes('bigquery', 'v2');
  await writeFile('./bigquery.d.ts', types);
}

fetch(api, version)

Fetches the Discovery Document resource.

Refer to the getRest Documentation for more details.

const {fetch} = require('discovery-tsd');

async function getJSON() {
  const json = await fetch('bigquery', 'v2');
}

render(json, [options])

Creates types for the supplied Discovery Document JSON.

const {fetch, render} = require('discovery-tsd');

async function createTypes() {
  const json = await fetch('bigquery', 'v2');
  return render(json);
}

License

ISC

Keywords

FAQs

Package last updated on 12 Apr 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