Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

declare module 'data-store' {
declare module '@juln/data-store' {
interface Options {
/**Disabled by default. Milliseconds to delay writing the JSON file to the file system. This can make the store more performant by preventing multiple subsequent writes after calling .set or setting/getting store.data, but comes with the potential side effect that (when accessing the object directly) the persisted file might be outdated during the timeout. To get around this, use data-store's API to (re-)load the file instead of directly reading the file (using fs.readFile for example). */
debounce?: number
Expand All @@ -23,7 +23,7 @@ declare module 'data-store' {
* Initialize a new Store with the given name, options and default data.
*/

class Store {
export class Store {
constructor (name?: string, options?: Options, defaults?: any)
constructor (options?: Options, defaults?: any)

Expand Down Expand Up @@ -100,5 +100,9 @@ declare module 'data-store' {

unlink: () => void
}
export = Store

function createDataStore(name?: string, options?: Options, defaults?: any): Store;
function createDataStore(options?: Options, defaults?: any): Store;

export default createDataStore;
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Store {
*/

get(key, fallback) {
if (typeof key === 'undefined') {
if (typeof key === 'undefined') {
return this.data;
}
assert.equal(typeof key, 'string', 'expected key to be a string');
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "data-store",
"name": "@juln/data-store",
"description": "Easily persist and load config data. No dependencies.",
"version": "4.1.0",
"homepage": "https://github.com/jonschlinkert/data-store",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"version": "1.0.2",
"typings": "index.d.ts",
"homepage": "https://github.com/z-juln/data-store",
"author": "juln (https://github.com/z-juln)",
"contributors": [
"Brian Woodward (https://twitter.com/doowb)",
"Jamen Marz (jamenmarz.com)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Olsten Larck (https://i.am.charlike.online)"
"Olsten Larck (https://i.am.charlike.online)",
"juln (https://github.com/z-juln)"
],
"repository": "jonschlinkert/data-store",
"repository": "z-juln/data-store",
"bugs": {
"url": "https://github.com/jonschlinkert/data-store/issues"
"url": "https://github.com/z-juln/data-store/issues"
},
"license": "MIT",
"files": [
Expand Down