npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arcanophile

v1.0.1

Published

File system read/write utility toolkit

Downloads

1

Readme

arcanophile

Installation

npm i arcanophile
import { readFile } from "arcanophile";

Functions

folderExists(targetPath, createOnRun) ⇒ Boolean

Checks if path exists and is actually a directory, optionally creates the folder whenever investigated

Kind: global function
Returns: Boolean - Whether path existed at time of investigating

| Param | Type | Default | Description | | --- | --- | --- | --- | | targetPath | String | | Relative or absolute file path | | createOnRun | Boolean | true | If TRUE, create empty folder if didn't previously exist |

fileExists(targetPath, createOnRun) ⇒ Boolean

Returns Boolean if path exists and it's a valid folder, optionally creates the folder whenever investigated

Kind: global function
Returns: Boolean - Whether path exists

| Param | Type | Description | | --- | --- | --- | | targetPath | String | Relative or absolute file path | | createOnRun | Boolean | If TRUE, create empty folder if didn't previously exist |

exists(targetPath) ⇒ Boolean

Type independent function to check existence of path

Kind: global function
Returns: Boolean - Whether path exists

| Param | Type | Description | | --- | --- | --- | | targetPath | String | Relative or absolute file path |

makeFolder(targetPath) ⇒ Boolean

Shorter alias of a mkdir function to create a folder at specified path

Kind: global function
Returns: Boolean - Whether folder creation was successful

| Param | Type | Description | | --- | --- | --- | | targetPath | String | Relative or absolute file path |

makeFile(targetPath, data, options) ⇒ Boolean

Shorter alias of a writeFileSync function to create a file at specified path

Kind: global function
Returns: Boolean - Whether folder creation was successful

| Param | Type | Default | Description | | --- | --- | --- | --- | | targetPath | String | | Relative or absolute file path | | data | String | Buffer | URL | | Contents of file | | options | Object | | Key/values for encoding, mode, and flag |

isFolder(targetPath) ⇒ Boolean

Verify a given path string is actually a directory and not a type of file

Kind: global function
Returns: Boolean - Whether path exists

| Param | Type | Description | | --- | --- | --- | | targetPath | String | Relative or absolute file path |

readFiles(folderPath, verbose) ⇒ Array

Thenable way to get all the file contents of a folder path

Kind: global function
Returns: Array - String data of each file contained within

| Param | Type | Default | Description | | --- | --- | --- | --- | | folderPath | String | | Relative or absolute folder path | | verbose | Boolean | true | If false, only return file content, otherwise return detailed File object |

readFile(folderPath, verbose) ⇒ Array

Thenable way to get a file's contents

Kind: global function
Returns: Array - String data of each file contained within

| Param | Type | Description | | --- | --- | --- | | folderPath | String | Relative or absolute folder path | | verbose | Boolean | If false, only return file content, otherwise return detailed File object |

readDirs(folderPath, flatten) ⇒ Array

Returns the children filepaths of each folder Array entry

Kind: global function
Returns: Array - Any filepaths contained within a target folderpath entry

| Param | Type | Description | | --- | --- | --- | | folderPath | String | Relative or absolute folder path | | flatten | Boolean | Return as a single Array, otherwise return as Array of separate nested Arrays |

readDir(folderPath) ⇒ Array

Returns the children filepaths of given folder path

Kind: global function
Returns: Array - Paths to each child file entry

| Param | Type | Description | | --- | --- | --- | | folderPath | String | Relative or absolute folder path |