streamer-fs

1.0.1 • Public • Published

fs-stream

It is a file copier using only one stream!

Example

import { send, receive } from "streamer-fs"
import { pipeline } from "stream/promises"

await pipeline(
    await send("files", async (file) => {
      const res = !fs.existsSync(path.join("copied", file))
      if (res) {
        console.log(file)
      }
      return res
    }),
    receive("copied")
  )
  • "files" and "copied" are directory names.
  • "send" can have second argument callback function which receives filepath as argument, you can return false to skip the file.

Readme

Keywords

Package Sidebar

Install

npm i streamer-fs

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

5.67 kB

Total Files

14

Last publish

Collaborators

  • amanparmar