██████ ██▓ ███▄ █ ▓█████ █ █░ ▒██ ▒ ▓██▒ ██ ▀█ █ ▓█ ▀ ▓█░ █ ░█░ ░ ▓██▄ ▒██▒▓██ ▀█ ██▒▒███ ▒█░ █ ░█ ▒ ██▒░██░▓██▒ ▐▌██▒▒▓█ ▄ ░█░ █ ░█ ▒██████▒▒░██░▒██░ ▓██░░▒████▒░░██▒██▓ ▒ ▒▓▒ ▒ ░░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░░
npm install sinew ██████ ██▓ ███▄ █ ▓█████ █ █░
▒██ ▒ ▓██▒ ██ ▀█ █ ▓█ ▀ ▓█░ █ ░█░
░ ▓██▄ ▒██▒▓██ ▀█ ██▒▒███ ▒█░ █ ░█
▒ ██▒░██░▓██▒ ▐▌██▒▒▓█ ▄ ░█░ █ ░█
▒██████▒▒░██░▒██░ ▓██░░▒████▒░░██▒██▓
▒ ▒▓▒ ▒ ░░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▓░▒ ▒
░ ░▒ ░ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ░ ▒ ░ ░
░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░
##### Table of Contents
- helpWithOptions
- Parameters
- readRaw
- Parameters
- Examples
- readUTF8
- Parameters
- Examples
- readFile
- Parameters
- Examples
- writeRaw
- Parameters
- Examples
- writeRaw
- Parameters
- Examples
- writeFile
- Parameters
- Examples
- is
- Parameters
- matches
- Parameters
- testCLI
- Parameters
- testCLI
- Parameters
#### helpWithOptions
Convert a yargs-parser object and a config into a help string
##### Parameters
- conf object a configuration object
- argv object a yargs-parser parsed argv
Returns string formatted string
#### readRaw
fs.readFile but curried
##### Parameters
- path string path-to-a-file
- format string file format
- callback function standard nodeback style callback
##### Examples
``javascript
import { readRaw } from "sinew"
import { pipe, map, __ as skip } from "ramda"
import { node } from "fluture"
export readFileAndDoStuff = pipe(
pipe(
readRaw(skip, 'utf8'),
node
),
map(x => "preamble:\n" + x)
)
`
Returns any null
#### readUTF8
fs.readFile but curried and with utf8 format chosen
##### Parameters
- path string path-to-a-filecallback
- function a node-style nodeback function
##### Examples
`javascript
import { readUTF8 } from "sinew"
import { pipe, map, __ as skip } from "ramda"
import { node } from "fluture"
export readFileAndDoStuff = pipe(
pipe(
readUTF8(skip),
node
),
map(x => "preamble:\n" + x)
)
`
Returns string a future value of a string
#### readFile
fs.readFile but utf8 and returning a Future
##### Parameters
- path string path-to-a-file
##### Examples
`javascript
import { readFile } from "sinew"
import { pipe, map } from "ramda"
export readFileAndDoStuff = pipe(
readFile,
map(x => "preamble:\n" + x)
)
`
Returns Future<string> a future value of a string
#### writeRaw
fs.readFile but curried; arity 4
##### Parameters
- path string path-to-a-filedata
- any data to write to a pathformat
- (string \| object) format or optscallback
- function a nodeback-style callback function
##### Examples
`javascript`
import {writeRaw} from "sinew"
writeRaw("my-file.md", "cool", "utf8", (e) => {
if(e) console.warn(e)
// done
})
#### writeRaw
fs.readFile but curried; format utf8
##### Parameters
- path string path-to-a-filedata
- any data to write to a pathcallback
- function a nodeback-style callback function
##### Examples
`javascript
import { writeUTF8 } from "sinew"
writeUTF8('my-file.md', 'cool', (e) => {
if(e) console.warn(e)
// done
})
`
#### writeFile
Write a utf8 file and wrap the action in a future
##### Parameters
- to string path-to-a-filedata
- string data to write
##### Examples
`javascript
import { writeFile, readFile } from "sinew"
import { curry, pipe, map, chain } from "ramda"
const prepend = curry((pre, file, data) => pipe(
readFile(file),
map(raw => pre = raw),
chain(writeFile)
))
`
Returns Future<string> a future-wrapped value(?)
#### is
expect(actual).toEqual(expected) but curried
##### Parameters
- expected any an expected valueactual
- any the actual value
Returns boolean
#### matches
expect(actual).toMatchSnapshot alias as a unary function
##### Parameters
- x any a value
Returns boolean a boolean value
#### testCLI
A simplified way of testing asynchronous command-line calls using execa.shell
Designed for jest testing
##### Parameters
- cli Array<string> commands and flags to pass to execatestName
- string the name of your testassertion
- function an assertion function. receives actual value as only param
#### testCLI
A simplified way of testing asynchronous command-line calls
Designed for jest testing
##### Parameters
- cli Array<string> commands and flags to pass to execatestName
- string the name of your testassertion` function an assertion function. receives actual value as only param
-