### Install startpoint with npm Source: https://github.com/andreasmadsen/startpoint/blob/master/README.md Install the startpoint package using npm. The command is shown in a shell block. ```shell npm install startpoint ``` -------------------------------- ### Convert buffer, error, or array to stream with startpoint Source: https://github.com/andreasmadsen/startpoint/blob/master/README.md Shows how to use startpoint to convert a buffer, an error, or an array of objects into a stream. The buffer example pipes to a file write stream, the error example pipes to an error handling stream, and the array example uses objectMode to pipe to an object stream. ```JavaScript var fs = require('fs'; var startpoint = require('startpoint'); startpoint(new Buffer('written to file')).pipe(fs.createWriteStream('file.txt')); startpoint(new Error('ups, an error')).pipe(/* Error handling stream */); startpoint([{msg: 'Hallo'}, {msg: 'World'}], {objectMode: true}).pipe(/* Object stream */); ``` -------------------------------- ### startpoint(bufferOrArrayOrError, options?) Source: https://github.com/andreasmadsen/startpoint/blob/master/README.md Creates a ReadStream that converts a buffer or array of objects into a stream. If an Error is passed, the stream emits that error. ```APIDOC ## startpoint(bufferOrArrayOrError, options?) ### Description Creates a ReadStream that converts a buffer or array of objects into a stream. If an Error is passed, the stream emits that error. ### Parameters - **bufferOrArrayOrError** (Buffer|Array|Error) - Required - The data to convert into a stream. If an Error, the stream will emit it. - **options** (Object) - Optional - Stream options, e.g., `{ objectMode: true }` for object streams. ### Returns - **ReadStream** - A readable stream that emits the provided data. ### Example ```JavaScript var fs = require('fs'); var startpoint = require('startpoint'); startpoint(new Buffer('written to file')).pipe(fs.createWriteStream('file.txt')); startpoint(new Error('ups, an error')).pipe(/* Error handling stream */); startpoint([{msg: 'Hallo'}, {msg: 'World'}], {objectMode: true}).pipe(/* Object stream */); ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.