0.1.22 • Published 6 years ago

haste-task-read v0.1.22

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

haste-task-read

Haste task for reading files from the file system.

The task returns a promise with an array of virtual files:

  • A virtual file consists of two things:
    1. filename <string> - the file path relative to process.cwd().
    2. content <string> - the content of the file encoded to utf-8.
    3. cwd <string> - filename is resolved relativley to this directory.
run(read({ pattern: '**.*'}))
  .then(virtualFiles => console.log(virtualFiles))

// [{ filename: "./realtive/path/to/file.js", content: "file content"}]

options

pattern

Type: String|Array<String>

A glob pattern(s) to be matched against.

options

Type: Object

Customization object for glob matching.

Note: This task uses globby under the hood. Please see it's documentation to see the available patterns and options.

0.1.22

6 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.5

7 years ago

0.1.0

7 years ago