Skip to content

Small utility for dealing with files inside tests (not for use in production)

License

Notifications You must be signed in to change notification settings

binded/kitchenfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kitchenfile

Build Status

Small utility for dealing with files in tests. Only use in tests!

import kitchenfile from 'kitchenfile'

const file = kitchenfile(`${__dirname}/files`)
// or: const file = kitchenfile(__dirname, files)

// Calls to file() are memoized!
file('image.jpg').rs() // returns a readable stream
file('image.jpg').buf // returns a buffer
file('image.jpg').path // path to image.jpg
file('image.jpg').contentType // content type based on file ext (e.g.  image/jpg)
file('image.jpg').size // file size in bytes
file('image.jpg').filename // => image.jpg

Install

npm install --save-dev kitchenfile

Requires Node v6+

Usage

See ./test directory for usage examples.

About

Small utility for dealing with files inside tests (not for use in production)

Resources

License

Stars

Watchers

Forks

Packages

No packages published