Skip to content

Commit

Permalink
remove configstore dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
amitguptagwl committed Jul 27, 2019
1 parent 84f11db commit 52d0ef9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 86 deletions.
67 changes: 9 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"zombie": "^5.0.8"
},
"dependencies": {
"configstore": "^4.0.0",
"nimnjs": "^1.3.2"
},
"typings": "src/parser.d.ts"
Expand Down
29 changes: 2 additions & 27 deletions tasks/postinstall.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
#!/usr/bin/env node

function main() {
if (process.env.SUPPRESS_SUPPORT) {
return;
}

const msg = '\u001b[32mLove fast-xml-parser? You can now support the project on following:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/fast-xml-parser/donate\u001b[0m\n > \u001b[96m\u001b[1mhttps://www.patreon.com/bePatron?u=9531404\u001b[0m\n';
try {
const Configstore = require('configstore');
const pkg = require(__dirname + '/../package.json');
const now = Date.now();

var week = 1000 * 60 * 60 * 24 * 7;

// create a Configstore instance with an unique ID e.g.
// Package name and optionally some default values
const conf = new Configstore(pkg.name);
const last = conf.get('lastCheck');

if (!last || now - week > last) {
console.log(msg);
conf.set('lastCheck', now);
}
} catch (e) {
console.log(msg);
}
}

main();
const msg = '\u001b[96m\u001b[1mLove fast-xml-parser? Check \u001b[32mhttps://amitkumargupta.work \u001b[96m\u001b[1mfor more projects and contribution.\u001b[0m\n';
console.log(msg)

0 comments on commit 52d0ef9

Please sign in to comment.