Comparing version 2.1.0 to 2.2.0
@@ -1,45 +0,69 @@ | ||
export interface Options { | ||
/** | ||
* **Don't use this option unless you really have to!** | ||
* | ||
* Suffix appended to the project name to avoid name conflicts with native apps. Pass an empty string to disable it. | ||
* | ||
* @default 'nodejs' | ||
*/ | ||
readonly suffix?: string; | ||
declare namespace envPaths { | ||
export interface Options { | ||
/** | ||
__Don't use this option unless you really have to!__ | ||
Suffix appended to the project name to avoid name conflicts with native apps. Pass an empty string to disable it. | ||
@default 'nodejs' | ||
*/ | ||
readonly suffix?: string; | ||
} | ||
export interface Paths { | ||
/** | ||
Directory for data files. | ||
*/ | ||
readonly data: string; | ||
/** | ||
Directory for data files. | ||
*/ | ||
readonly config: string; | ||
/** | ||
Directory for non-essential data files. | ||
*/ | ||
readonly cache: string; | ||
/** | ||
Directory for log files. | ||
*/ | ||
readonly log: string; | ||
/** | ||
Directory for temporary files. | ||
*/ | ||
readonly temp: string; | ||
} | ||
} | ||
export interface Paths { | ||
declare const envPaths: { | ||
/** | ||
* Directory for data files. | ||
*/ | ||
readonly data: string; | ||
Get paths for storing things like data, config, cache, etc. | ||
/** | ||
* Directory for data files. | ||
*/ | ||
readonly config: string; | ||
@param name - Name of your project. Used to generate the paths. | ||
@returns The paths to use for your project on current OS. | ||
/** | ||
* Directory for non-essential data files. | ||
*/ | ||
readonly cache: string; | ||
@example | ||
``` | ||
import envPaths = require('env-paths'); | ||
/** | ||
* Directory for log files. | ||
*/ | ||
readonly log: string; | ||
const paths = envPaths('MyApp'); | ||
/** | ||
* Directory for temporary files. | ||
*/ | ||
readonly temp: string; | ||
} | ||
paths.data; | ||
//=> '/home/sindresorhus/.local/share/MyApp-nodejs' | ||
/** | ||
* Get paths for storing things like data, config, cache, etc. | ||
* | ||
* @param name - Name of your project. Used to generate the paths. | ||
* @returns The paths to use for your project on current OS. | ||
*/ | ||
export default function envPaths(name: string, options?: Options): Paths; | ||
paths.config | ||
//=> '/home/sindresorhus/.config/MyApp-nodejs' | ||
``` | ||
*/ | ||
(name: string, options?: envPaths.Options): envPaths.Paths; | ||
// TODO: Remove this for the next major release, refactor the whole definition to: | ||
// declare function envPaths(name: string, options?: envPaths.Options): envPaths.Paths; | ||
// export = envPaths; | ||
default: typeof envPaths; | ||
}; | ||
export = envPaths; |
@@ -73,2 +73,3 @@ 'use strict'; | ||
module.exports = envPaths; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = envPaths; |
{ | ||
"name": "env-paths", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Get paths for storing things like data, config, cache, etc", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -42,6 +42,6 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^1.2.1", | ||
"tsd-check": "^0.3.0", | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.1", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6607
114