Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

function-file-tools

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-file-tools

Small (hopefully) library to interact with files in Functional Programmming Style

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

WAT

Small (hopefully) library to interact with files in Functional Programming Style.

AKA

All monad goodies of functional programing : ramda, data.task now combined with streams and node file programs.

How

npm install function-file-tools --save

Usage

Using es2015 style with object-stream-tools

const { readFileStream } = require('function-file-tools')
const ost = require('object-stream-tools')

const app = readFileStream(__dirname + '/README.md')
    .map(ost.map(e => e.split(/\n|\t/gi))
    .pipe(process.stdout))

app.fork(console.error, console.log)

Using ramda curried functions

const { readFileStream } = require('function-file-tools')
const ost = require('object-stream-tools')
const { split } = require('ramda')

const app = readFileStream(__dirname + '/README.md')
    .map(ost.map(split(/\n|\t/gi))
    .pipe(process.stdout))

app.fork(console.error, console.log)

Using node v.7 with --harmony

import { readFile, readFileStream, writeFile } from 'function-file-tools'

const app = readFile(__dirname + '/README.txt')
        .map(e => e.split(/\n|\t/gi))
        .chain(contents => writeFile(__dirname + '/.tmp.txt', contents))

// when you want to have side effect
app.fork(console.error, console.log)

Test

ava test

FAQs

Package last updated on 17 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc