Skip to content

Commit

Permalink
Replace configstore with conf
Browse files Browse the repository at this point in the history
Configstore store files in the home directory, which often have the wrong permissions for users and causes problems, like wulkano/Kap#351
  • Loading branch information
sindresorhus committed Feb 5, 2018
1 parent 9deeeda commit dae6dd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const path = require('path');
const childProcess = require('child_process');
const osName = require('os-name');
const Configstore = require('configstore');
const Conf = require('conf');
const chalk = require('chalk');
const debounce = require('lodash.debounce');
const inquirer = require('inquirer');
Expand Down Expand Up @@ -37,8 +37,11 @@ class Insight {
this.os = osName();
this.nodeVersion = process.version;
this.appVersion = this.packageVersion;
this.config = options.config || new Configstore(`insight-${this.packageName}`, {
clientId: options.clientId || Math.floor(Date.now() * Math.random())
this.config = options.config || new Conf({
configName: `insight-${this.packageName}`,
defaults: {
clientId: options.clientId || Math.floor(Date.now() * Math.random())
}
});
this._queue = {};
this._permissionTimeout = 30;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"async": "^2.1.4",
"chalk": "^2.3.0",
"configstore": "^3.1.1",
"conf": "^1.3.1",
"inquirer": "^5.0.0",
"lodash.debounce": "^4.0.8",
"os-name": "^2.0.1",
Expand Down

0 comments on commit dae6dd4

Please sign in to comment.