![Understanding the Security Concerns of npm Shrinkwrap](https://cdn.sanity.io/images/cgdhsj6q/production/37156cfb4523f411022d98b3b06138985ac81496-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Understanding the Security Concerns of npm Shrinkwrap
Explore the security risks of using npm shrinkwrap, the potential for outdated dependencies, and best practices for mitigating these concerns in your projects.
@types/download
Advanced tools
TypeScript definitions for download
Readme
npm install --save @types/download
This package contains type definitions for download (https://github.com/kevva/download).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/download.
/// <reference types="node" />
import { DecompressOptions } from "decompress";
import { GotEmitter, GotOptions } from "got";
import { Duplex } from "stream";
declare namespace download {
interface DownloadOptions extends DecompressOptions, GotOptions<string | null> {
/**
* If set to `true`, try extracting the file using
* [`decompress`](https://github.com/kevva/decompress).
*
* @default false
*/
extract?: boolean | undefined;
/**
* Name of the saved file.
*/
filename?: string | undefined;
}
}
/**
* Download and extract files.
*
* @param url URL to download.
* @param destination Path to where your file will be written.
* @param options Same options as [`got`](https://github.com/sindresorhus/got#options)
* and [`decompress`](https://github.com/kevva/decompress#options) in addition to the
* ones from this package.
*
* @example
* import fs from 'fs';
* import download = require('download');
*
* (async () => {
* await download('http://unicorn.com/foo.jpg', 'dist');
*
* fs.writeFileSync('dist/foo.jpg', await download('http://unicorn.com/foo.jpg'));
*
* download('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));
*
* await Promise.all([
* 'unicorn.com/foo.jpg',
* 'cats.com/dancing.gif'
* ].map(url => download(url, 'dist')));
* })();
*/
declare function download(
url: string,
destination?: string,
options?: download.DownloadOptions,
): Promise<Buffer> & GotEmitter & Duplex;
declare function download(url: string, options?: download.DownloadOptions): Promise<Buffer> & GotEmitter & Duplex;
export = download;
These definitions were written by Nico Jansen, and BendingBender.
FAQs
TypeScript definitions for download
The npm package @types/download receives a total of 60,475 weekly downloads. As such, @types/download popularity was classified as popular.
We found that @types/download demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Explore the security risks of using npm shrinkwrap, the potential for outdated dependencies, and best practices for mitigating these concerns in your projects.
Security News
Node.js is taking steps towards removing Corepack from its distribution, aiming for changes in the next major release.
Security News
OpenSSF has released a guide to help package repositories adopt Trusted Publishers, which enhances security by using short-lived identity tokens for authentication, reducing the risks associated with long-lived secrets.