Socket
Socket
Sign inDemoInstall

downlevel-dts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downlevel-dts

Convert d.ts to be compatible with older typescript compilers


Version published
Weekly downloads
151K
increased by9.42%
Maintainers
1
Weekly downloads
 
Created

What is downlevel-dts?

The downlevel-dts npm package is used to downlevel TypeScript declaration files (.d.ts) to an older version of TypeScript. This is useful for library authors who want to support older versions of TypeScript without maintaining multiple versions of their codebase.

What are downlevel-dts's main functionalities?

Downlevel TypeScript Declarations

This feature allows you to downlevel TypeScript declaration files to a specified TypeScript version. In this example, the input .d.ts file is downleveled to TypeScript version 3.7 and written to the output file.

const downlevelDts = require('downlevel-dts');
const fs = require('fs');

const inputFilePath = 'path/to/input.d.ts';
const outputFilePath = 'path/to/output.d.ts';

const inputDts = fs.readFileSync(inputFilePath, 'utf8');
const outputDts = downlevelDts(inputDts, '3.7');

fs.writeFileSync(outputFilePath, outputDts);

Other packages similar to downlevel-dts

FAQs

Package last updated on 29 Aug 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