npm.io
0.8.33 • Published 2 years ago

@types/jsonstream

Licence
MIT
Version
0.8.33
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/jsonstream

Summary

This package contains type definitions for jsonstream (https://github.com/dominictarr/JSONStream).

Details

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

index.d.ts

/// <reference types="node" />

export interface Options {
    recurse: boolean;
}

export function parse(pattern: any): NodeJS.ReadWriteStream;
export function parse(patterns: any[]): NodeJS.ReadWriteStream;

/**
 * Create a writable stream.
 * You may pass in custom open, close, and seperator strings, but, by default,
 * JSONStream.stringify() will create an array,
 * (with default options open='[\n', sep='\n,\n', close='\n]\n')
 */
export function stringify(): NodeJS.ReadWriteStream;

/**
 * Create a writable stream.
 * You may pass in custom open, close, and seperator strings.
 */
export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream;

/** Creates a writable stream where elements are only seperated by a newline. */
export function stringify(newlineOnly: NewlineOnlyIndicator): NodeJS.ReadWriteStream;
export type NewlineOnlyIndicator = false;

export function stringifyObject(): NodeJS.ReadWriteStream;
export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0337 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Bart van der Schoor.