Socket
Socket
Sign inDemoInstall

@typedash/fs

Package Overview
Dependencies
2
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @typedash/fs

`fp-ts` compliant `fs-extra` wrappers


Version published
Maintainers
2
Created

Readme

Source

@typedash/fs

Wraps methods from fs-extra to make them more compatible with the fp-ts ecosystem.

Installation

npm install @typedash/fs
yard add --save @typedash/fs

Example

Below is an example of how you would/could use this package in your project.

import path from 'path'
import { z } from 'zod'
import { fs } from '@typedash/fs'
import { R, TE, flow, pipe } from '@typedash/typedash'

const PACKAGE_PATH = path.join(__dirname, '..', 'package.json')

const PackageJson = z.object({ name: z.string() })

pipe(
  VERSION_INFO_PATH,
  fs.readJson(),
  TE.chain(TE.fromZodParse(PackageJson)),
  TE.map(R.prop('name'))
  TE.logTag('🔢 PackageJson Name'),
)
// TE.TaskEither<Error, string>

External References

PackageDocs Url
fp-tshttps://gcanti.github.io/fp-ts/modules/
fshttps://github.com/jprichardson/node-fs-extra

FAQs

Last updated on 14 Nov 2023

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc