@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
42 lines (41 loc) • 1.77 kB
TypeScript
/**
* Tokenizes the arguments string into an array of strings, supporting quoted
* values and escaped characters.
* Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401
*
* @param input - The arguments string to be tokenized.
* @returns An array of strings with the tokenized arguments.
*/
export declare const tokenizeArgs: (input: string) => string[];
/**
* Stringify the arguments to be used in a command line. It will ignore any
* argument that has a value of `undefined`.
*
* @param args - The arguments to be stringified.
* @returns A string with the arguments.
*/
export declare function formatNodeOptions(args: Record<string, string | boolean | undefined>): string;
/**
* Get the node options from the `NODE_OPTIONS` environment variable and parse
* them into an object without the inspect options.
*
* @returns An object with the parsed node options.
*/
export declare function getParsedNodeOptionsWithoutInspect(): {
[longOption: string]: string | boolean | undefined;
};
/**
* Get the node options from the `NODE_OPTIONS` environment variable and format
* them into a string without the inspect options.
*
* @returns A string with the formatted node options.
*/
export declare function getFormattedNodeOptionsWithoutInspect(): string;
/**
* Returns the package registry using the user's package manager. The URL will have a trailing slash.
*
* @param baseDir - The base directory to detect the package manager from.
* @returns The package registry URL with a trailing slash.
* @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.
*/
export declare function getRegistry(baseDir?: string): Promise<string>;