New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@types/write

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/write

TypeScript definitions for write

ts3.6
ts3.7
ts3.8
ts3.9
ts4.0
ts4.1
ts4.2
ts4.3
ts4.4
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/write

Summary

This package contains type definitions for write (https://github.com/jonschlinkert/write).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/write.

index.d.ts

// Type definitions for write 2.0
// Project: https://github.com/jonschlinkert/write
// Definitions by: Junxiao Shi <https://github.com/yoursunny>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

/// <reference types="node" />
import * as fs from "fs";

type Data = string|Buffer|Uint8Array;

interface CommonOptions {
    newline?: boolean | undefined;
    overwrite?: boolean | undefined;
    increment?: boolean | undefined;
}

type Options = Omit<fs.WriteFileOptions, "encoding"> &
               Omit<fs.MakeDirectoryOptions, "recursive"> &
               CommonOptions;

type CreateWriteStreamOptions = Extract<Parameters<typeof fs.createWriteStream>[1], Record<string, any>>;

type StreamOptions = Omit<CreateWriteStreamOptions, "encoding"> &
                     Omit<fs.MakeDirectoryOptions, "recursive"> &
                     CommonOptions;

interface Result<T extends Data> {
    path: string;
    data: T;
}

type Callback<T extends Data> = (err: Error|null, result?: Result<T>) => any;

declare function write<T extends Data>(filepath: string, data: T, options: Options, callback: Callback<T>): void;
declare function write<T extends Data>(filepath: string, data: T, callback: Callback<T>): void;
declare function write<T extends Data>(filepath: string, data: T, options?: Options): Promise<Result<T>>;

declare namespace write {
    function sync<T extends Data>(filepath: string, data: T, options?: Options): Result<T>;

    function stream(filepath: string, options?: StreamOptions): fs.WriteStream;
}

export = write;

Additional Details

  • Last updated: Fri, 02 Jul 2021 18:06:03 GMT
  • Dependencies: @types/node
  • Global values: none

Credits

These definitions were written by Junxiao Shi.

FAQs

Package last updated on 02 Jul 2021

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