@persistr/clif-plugin-settings
Advanced tools
+12
-3
| const Settings = require('@persistr/settings') | ||
| const os = require('os') | ||
| module.exports = { | ||
| let name = '.cli' | ||
| const settings = { | ||
| initialize: (toolbox) => { | ||
| const isBrowser = typeof window !== 'undefined' && ({}).toString.call(window) === '[object Window]' | ||
| if (isBrowser) { | ||
| toolbox.settings = Settings.localStorage('.persistr.cli') | ||
| toolbox.settings = Settings.localStorage(`${name}`) | ||
| } | ||
| else { | ||
| toolbox.settings = Settings.file(`${os.homedir}/.persistr.cli`) | ||
| toolbox.settings = Settings.file(`${os.homedir}/${name}`) | ||
| } | ||
| } | ||
| } | ||
| settings.name = (n) => { | ||
| name = n | ||
| return settings | ||
| } | ||
| module.exports = settings |
+1
-1
| { | ||
| "name": "@persistr/clif-plugin-settings", | ||
| "version": "2.1.0", | ||
| "version": "2.2.0", | ||
| "description": "Persistent settings plugin for @persistr/clif", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1389
7.01%19
46.15%