cli-helpers
Advanced tools
Comparing version 1.1.0 to 1.1.1
/** | ||
* @description look for the file from the current or parent directory recursively | ||
* @description look for the file from the given directory or parent directory recursively | ||
* @example | ||
* ``` | ||
* let file = resolveFile('package.json') | ||
* let file = resolveFile({ dir: __dirname, filename: 'package.json' }) | ||
* let pkg = readJSONFile(file) | ||
* ``` | ||
*/ | ||
export declare function resolveFile(filename: string): string; | ||
export declare function resolveFile(args: { | ||
dir: string; | ||
filename: string; | ||
}): string; | ||
/** | ||
@@ -11,0 +14,0 @@ * @description read file as json data |
@@ -10,11 +10,11 @@ "use strict"; | ||
/** | ||
* @description look for the file from the current or parent directory recursively | ||
* @description look for the file from the given directory or parent directory recursively | ||
* @example | ||
* ``` | ||
* let file = resolveFile('package.json') | ||
* let file = resolveFile({ dir: __dirname, filename: 'package.json' }) | ||
* let pkg = readJSONFile(file) | ||
* ``` | ||
*/ | ||
function resolveFile(filename) { | ||
let dir = __dirname; | ||
function resolveFile(args) { | ||
let { dir, filename } = args; | ||
for (;;) { | ||
@@ -21,0 +21,0 @@ let file = (0, path_1.join)(dir, filename); |
{ | ||
"name": "cli-helpers", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Helper library for building cli applications", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -69,10 +69,10 @@ # cli-helpers | ||
/** | ||
* @description look for the file from the current or parent directory recursively | ||
* @description look for the file from the given directory or parent directory recursively | ||
* @example | ||
* ``` | ||
* let file = resolveFile('package.json') | ||
* let file = resolveFile({ dir: __dirname, filename: 'package.json' }) | ||
* let pkg = readJSONFile(file) | ||
* ``` | ||
*/ | ||
export function resolveFile(filename: string): string | ||
export function resolveFile(args: { dir: string; filename: string }): string | ||
@@ -79,0 +79,0 @@ /** |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10371
177
0