Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cosmiconfig

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cosmiconfig - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

5

CHANGELOG.md
# Changelog
## 3.0.1
- Fixed: memory leak due to bug in `require-from-string`.
- Added: for JSON files, append position to end of error message.
## 3.0.0

@@ -4,0 +9,0 @@

7

dist/createExplorer.js

@@ -138,7 +138,6 @@ //

const splitPath = directory.split(path.sep);
const nextDirectory =
splitPath.length > 1 ? splitPath.slice(0, -1).join(path.sep) : null;
const nextDirectory = path.dirname(directory);
if (!nextDirectory || directory === options.stopDir) return null;
if (nextDirectory === directory || directory === options.stopDir)
return null;

@@ -145,0 +144,0 @@ return searchDirectory(nextDirectory);

@@ -49,5 +49,5 @@ //

(jsonContent ) => {
if (foundConfig) {
return;
} else if (jsonContent) {
// Since this is the first try, config cannot have been found, so don't
// check `if (foundConfig)`.
if (jsonContent) {
const successFilepath = `${filepath}.json`;

@@ -105,6 +105,4 @@ foundConfig = {

function readRcFile(extension ) {
const filepathWithExtension = extension
? `${filepath}.${extension}`
: filepath;
function readRcFile(extension ) {
const filepathWithExtension = `${filepath}.${extension}`;
return !options.sync

@@ -111,0 +109,0 @@ ? readFile(filepathWithExtension)

{
"name": "cosmiconfig",
"version": "3.0.0",
"version": "3.0.1",
"description": "Find and load configuration from a package.json property, rc file, or CommonJS module",
"main": "dist/index.js",
"files": [
"index.js",
"dist"

@@ -15,3 +14,3 @@ ],

"pretest": "npm run lint && flow check",
"test": "jest",
"test": "jest --coverage",
"test:watch": "jest --watch",

@@ -58,3 +57,11 @@ "coverage": "jest --coverage --coverageReporters=html --coverageReporters=text",

"src/*.js"
]
],
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
}
},

@@ -69,11 +76,11 @@ "babel": {

"js-yaml": "^3.9.0",
"parse-json": "^2.2.0",
"require-from-string": "^1.1.0"
"parse-json": "^3.0.0",
"require-from-string": "^2.0.1"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"babel-eslint": "^8.0.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"eslint": "^4.5.0",
"eslint": "^4.7.0",
"eslint-config-davidtheclark-node": "^0.2.0",
"eslint-config-prettier": "^2.3.0",
"eslint-config-prettier": "^2.5.0",
"eslint-plugin-flowtype": "^2.35.1",

@@ -84,5 +91,5 @@ "eslint-plugin-node": "^3.0.5",

"husky": "^0.14.3",
"jest": "^20.0.4",
"lint-staged": "^4.0.4",
"prettier": "^1.6.1"
"jest": "^21.1.0",
"lint-staged": "^4.2.1",
"prettier": "^1.7.0"
},

@@ -89,0 +96,0 @@ "engines": {

@@ -9,3 +9,2 @@ # cosmiconfig

- a `.config.js` CommonJS module (anywhere down the file tree)
- a CLI `--config` argument

@@ -16,3 +15,2 @@ For example, if your module's name is "soursocks," cosmiconfig will search out configuration in the following places:

- a `soursocks.config.js` file exporting a JS object (anywhere down the file tree)
- a CLI `--config` argument

@@ -68,3 +66,3 @@ cosmiconfig continues to search in these places all the way down the file tree until it finds acceptable configuration (or hits the home directory).

All this searching can be short-circuited by passing `options.configPath` or a `--config` CLI argument to specify a file.
All this searching can be short-circuited by passing `options.configPath` to specify a file.
cosmiconfig will read that file and try parsing it as JSON, YAML, or JS.

@@ -71,0 +69,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc