node-ainzfb-new 1.6.2911-test → 1.7.1-beta

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # Changelog
2
+ Too lazy to write changelog, sorry! (will write changelog in the next release, through.)
@@ -0,0 +1,23 @@
1
+ const db = require('../index');
2
+
3
+ // Setting an object in the database:
4
+ db.set('userInfo', { difficulty: 'Easy' })
5
+ // -> { difficulty: 'Easy' }
6
+
7
+ // Pushing an element to an array (that doesn't exist yet) in an object:
8
+ db.push('userInfo.items', 'Sword')
9
+ // -> { difficulty: 'Easy', items: ['Sword'] }
10
+
11
+ // Adding to a number (that doesn't exist yet) in an object:
12
+ db.add('userInfo.balance', 500)
13
+ // -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
14
+
15
+ // Repeating previous examples:
16
+ db.push('userInfo.items', 'Watch')
17
+ // -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
18
+ db.add('userInfo.balance', 500)
19
+ // -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
20
+
21
+ // Fetching individual properties
22
+ console.log(db.get('userInfo.balance')) // -> 1000
23
+ console.log(db.get('userInfo.items')) // ['Sword', 'Watch']
@@ -1,4 +1,4 @@
1
- var { join } = require('path')
1
+ var { join } = require('path');
2
2
  module.exports = {
3
3
  apps: [
4
4
  {