{"_id":"@types/write","_rev":"2931903","name":"@types/write","description":"TypeScript definitions for write","dist-tags":{"latest":"2.0.1","ts3.5":"2.0.0","ts3.6":"2.0.1","ts3.7":"2.0.1","ts3.8":"2.0.1","ts3.9":"2.0.1","ts4.0":"2.0.1","ts4.1":"2.0.1","ts4.2":"2.0.1","ts4.3":"2.0.1","ts4.4":"2.0.1","ts4.5":"2.0.1","ts4.6":"2.0.1","ts4.7":"2.0.1","ts4.8":"2.0.1","ts4.9":"2.0.1","ts5.0":"2.0.1","ts5.1":"2.0.1"},"maintainers":[{"name":"types","email":""}],"time":{"modified":"2023-03-14T06:28:58.000Z","created":"2019-10-22T21:08:00.554Z","2.0.1":"2021-07-02T19:07:43.598Z","2.0.0":"2019-10-22T21:08:00.554Z"},"users":{},"repository":{"type":"git","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","directory":"types/write"},"versions":{"2.0.1":{"name":"@types/write","version":"2.0.1","description":"TypeScript definitions for write","homepage":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/write","license":"MIT","contributors":[{"name":"Junxiao Shi","url":"https://github.com/yoursunny","githubUsername":"yoursunny"}],"main":"","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","directory":"types/write"},"scripts":{},"dependencies":{"@types/node":"*"},"typesPublisherContentHash":"387c68720f6a961be94d2b48b63721a82f65bd293df18f33d0de673e3527107d","typeScriptVersion":"3.6","_id":"@types/write@2.0.1","dist":{"shasum":"588d3ff577ed38e1159e3fed04269cfb96281160","size":2009,"noattachment":false,"key":"/@types/write/-/@types/write-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@types/write/download/@types/write-2.0.1.tgz"},"_npmUser":{"name":"types","email":"ts-npm-types@microsoft.com"},"directories":{},"maintainers":[{"name":"types","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write_2.0.1_1625252863450_0.25830252140037957"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T07:36:19.283Z","publish_time":1625252863598,"_cnpm_publish_time":1625252863598},"2.0.0":{"name":"@types/write","version":"2.0.0","description":"TypeScript definitions for write","license":"MIT","contributors":[{"name":"Junxiao Shi","url":"https://github.com/yoursunny","githubUsername":"yoursunny"}],"main":"","types":"index","repository":{"type":"git","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","directory":"types/write"},"scripts":{},"dependencies":{"@types/node":"*"},"typesPublisherContentHash":"0acedb261c7d8884ff7105358d0a9773bb33abd587a457bcc2ba82e0b231ac5d","typeScriptVersion":"3.5","_id":"@types/write@2.0.0","dist":{"shasum":"8d3bd091f99fb475955c58d9c5bcf1094b6a8551","size":1917,"noattachment":false,"key":"/@types/write/-/@types/write-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@types/write/download/@types/write-2.0.0.tgz"},"maintainers":[{"name":"types","email":""}],"_npmUser":{"name":"types","email":"ts-npm-types@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/write_2.0.0_1571778480465_0.45024752823187186"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T07:36:19.170Z","publish_time":1571778480554,"_cnpm_publish_time":1571778480554}},"readme":"# Installation\r\n> `npm install --save @types/write`\r\n\r\n# Summary\r\nThis package contains type definitions for write (https://github.com/jonschlinkert/write).\r\n\r\n# Details\r\nFiles were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/write.\r\n## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/write/index.d.ts)\r\n````ts\r\n// Type definitions for write 2.0\n// Project: https://github.com/jonschlinkert/write\n// Definitions by: Junxiao Shi <https://github.com/yoursunny>\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n// TypeScript Version: 3.5\n\n/// <reference types=\"node\" />\nimport * as fs from \"fs\";\n\ntype Data = string|Buffer|Uint8Array;\n\ninterface CommonOptions {\n    newline?: boolean | undefined;\n    overwrite?: boolean | undefined;\n    increment?: boolean | undefined;\n}\n\ntype Options = Omit<fs.WriteFileOptions, \"encoding\"> &\n               Omit<fs.MakeDirectoryOptions, \"recursive\"> &\n               CommonOptions;\n\ntype CreateWriteStreamOptions = Extract<Parameters<typeof fs.createWriteStream>[1], Record<string, any>>;\n\ntype StreamOptions = Omit<CreateWriteStreamOptions, \"encoding\"> &\n                     Omit<fs.MakeDirectoryOptions, \"recursive\"> &\n                     CommonOptions;\n\ninterface Result<T extends Data> {\n    path: string;\n    data: T;\n}\n\ntype Callback<T extends Data> = (err: Error|null, result?: Result<T>) => any;\n\ndeclare function write<T extends Data>(filepath: string, data: T, options: Options, callback: Callback<T>): void;\ndeclare function write<T extends Data>(filepath: string, data: T, callback: Callback<T>): void;\ndeclare function write<T extends Data>(filepath: string, data: T, options?: Options): Promise<Result<T>>;\n\ndeclare namespace write {\n    function sync<T extends Data>(filepath: string, data: T, options?: Options): Result<T>;\n\n    function stream(filepath: string, options?: StreamOptions): fs.WriteStream;\n}\n\nexport = write;\n\r\n````\r\n\r\n### Additional Details\r\n * Last updated: Fri, 02 Jul 2021 18:06:03 GMT\r\n * Dependencies: [@types/node](https://npmjs.com/package/@types/node)\r\n * Global values: none\r\n\r\n# Credits\r\nThese definitions were written by [Junxiao Shi](https://github.com/yoursunny).\r\n","_attachments":{},"homepage":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/write","license":"MIT"}