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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rosinfo.tech/node

v0.0.8

Published

[![rosinfo.tech](https://cdn.rosinfo.tech/id/logo/id_logo_width_160.svg "rosinfo.tech")](https://rosinfo.tech)

Readme

rosinfo.tech

@rosinfo.tech/node

Installation

npm i @rosinfo.tech/node

Usage

ES6:

import { isExists } from "@rosinfo.tech/node/isExists";

// or
// import { isExists } from "@rosinfo.tech/node";

// ...
if ( isExists( "/path/to/file/or/directory" ) ) {
// ...
}
// ...

CommonJS:

const { isExists } = require( "@rosinfo.tech/node/isExists" );

// or
// const { isExists } = require( "@rosinfo.tech/node" );

// ...
if ( isExists( "/path/to/file/or/directory" ) ) {
// ...
}
// ...

Functions

import { Stats, copyFile, readFile, writeFile } from "fs";

import { inspect as inspectUtil } from "util";

export declare const FILE_SYSTEM_ENCODING_DEFAULT = "utf8";

export declare const FILE_SYSTEM_INDENT_WHITE_SPACES = 4;

export declare const FILE_SYSTEM_MAP_AFTER_KEY = "__AFTER__";

export declare const SEP: "\\" | "/";

export declare const FILE_SYSTEM_EXCEPT_FILES: string[];

export interface IDirectoryReadThenableCallbackOptions {
    directoryFile: string;
    isDirectory: boolean;
    lstatDirectoryFile: Stats;
}

export interface IDirectoryReadOptions {
    accept?: string | RegExp | Array<string | RegExp>;
    except?: string | RegExp | Array<string | RegExp>;
    isAddDirectories?: boolean;
    isAddFiles?: boolean;
    isAddPath?: boolean;
    isLink?: boolean;
    isRecursive?: boolean;
    isRecursiveDependsOnTest?: boolean;
    isReturnDirectoryFiles?: boolean;
    isTestPath?: boolean;
    thenableCallback?: (options: IDirectoryReadThenableCallbackOptions) => Promise<unknown>;
}

export declare const directoryReadOptions: (options: any) => IDirectoryReadOptions;

export declare const directoryRead: (path: string, options?: IDirectoryReadOptions | boolean, returnInternal?: Array<string>) => Promise<Array<string>>;

interface IArchiveCreateOptions {
    encoding?: string;
    format: "zip" | "tar";
    logStandard?: boolean;
    mode?: number | string;
    onLog?: (...logData: Array<string | number>) => unknown;
}

export declare const ARCHIVE_CREATE_LOG_INITIAL = "ARCHIVE_CREATE_LOG_INITIAL";

export declare const ARCHIVE_CREATE_LOG_PATH_FILE_ADD = "ARCHIVE_CREATE_LOG_PATH_FILE_ADD";

export declare const ARCHIVE_CREATE_LOG_ON_ERROR = "ARCHIVE_CREATE_LOG_ON_ERROR";

export declare const ARCHIVE_CREATE_LOG_ON_WARNING = "ARCHIVE_CREATE_LOG_ON_WARNING";

export declare const ARCHIVE_CREATE_LOG_ON_SUCCESS = "ARCHIVE_CREATE_LOG_ON_SUCCESS";

export declare const archiveCreate: (pathFileArchive: string, pathOrPathFiles: string | Array<string>, pathRelative?: string | boolean, options?: Partial<IArchiveCreateOptions> & IDirectoryReadOptions) => Promise<unknown>;

export declare const archiveExtract: (pathFileArchive: any, pathExtract: any) => Promise<void>;

interface IDirectoryCopyOptions {
    isForce?: boolean;
    isReturnCopiedFiles?: false;
    modeCopyFile?: number;
    modeMkDir?: number | string;
}

export declare const directoryCopy: (directorySource: string, directoryDestination: string, options?: IDirectoryCopyOptions & IDirectoryReadOptions) => Promise<boolean | Array<string>>;

interface IDirectoryCreateOptions {
    mode?: number | string;
    recursive?: boolean;
}

export declare const directoryCreate: (path: any, options?: IDirectoryCreateOptions) => Promise<boolean>;

export declare const directoryEmptyUnlink: (path: string, options: IDirectoryReadOptions) => Promise<boolean>;

export declare const fileCopy: typeof copyFile.__promisify__;

export interface IFileJsonOptions {
    createIfDoesNotExist?: boolean;
    encoding?: BufferEncoding;
    indent?: number;
}

export declare const fileJsonRead: (pathFile: string, options?: IFileJsonOptions) => Promise<any>;

export declare const fileJsonFilter: (pathFile: string, filterPropertiesName: Array<string>, options?: IFileJsonOptions) => Promise<any>;

export declare const fileJsonWrite: (pathFile: string, data: any, options?: IFileJsonOptions) => Promise<boolean>;

interface IDirectoryFileCopyOptions {
    suppressErrors?: boolean;
}

export declare const filePathCopy: (sourcePathFile: string, destinationPathFile: string, options?: IDirectoryFileCopyOptions) => Promise<boolean>;

export declare const fileRead: typeof readFile.__promisify__;

export declare const fileWrite: typeof writeFile.__promisify__;

export declare const inspect: typeof inspectUtil;

export declare const isDirectory: (directoryArg: string) => boolean;

export declare const isExists: (pathFile: string) => boolean;

type TInspectParameters = Parameters<typeof inspect>;

export declare const logInspect: (inspected: TInspectParameters[0], options?: TInspectParameters[1]) => void;

interface IMapCopyOptions {
    context?: string;
    map?: Record<string, string>;
    suppressErrors?: boolean;
}

export declare const mapCopy: ({ context, map, suppressErrors }: IMapCopyOptions) => Promise<void>;

interface IMapJsonOptions {
    context?: string;
    map?: any;
    suppressErrors?: boolean;
}

export declare const mapJson: ({ context, map, suppressErrors }: IMapJsonOptions) => Promise<void>;

interface IMapUnlinkOptions {
    context?: string;
    map?: any;
    suppressErrors?: boolean;
}

export declare const mapUnlink: ({ context, map, suppressErrors }: IMapUnlinkOptions) => Promise<void>;

interface IMapWriteOptions {
    context?: string;
    map?: any;
    suppressErrors?: boolean;
}

export declare const mapWrite: ({ context, map }: IMapWriteOptions) => Promise<void>;

export declare const normalize: (pathFile: string) => string;

export declare const resolve: (...pathFiles: Array<string>) => string;

interface IUnlinkOptions {
    contentOnly?: boolean;
}

export declare const unlink: (pathFile: string, options?: IUnlinkOptions & IDirectoryReadOptions) => Promise<boolean>;