informa-db.js
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "informa-db.js", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "DataBases made easier", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,7 +12,6 @@ # Informa-Db.js | ||
```js | ||
const { Db, DbUtils } = require('informa-db.js'); // Require the package | ||
const { Db, DbUtils } = require('informa-db.js'); | ||
const players = new Db('players.json'); // Uses players.json to store Database | ||
const players = new Db('players.json'); | ||
// Instead, use this more elegant way of doing it: | ||
if (!players[process.env.PLAYER]) players[process.env.PLAYER] = { | ||
@@ -25,11 +24,2 @@ inventory: Array(20), | ||
const { value: gameState, setTo: resetGameState } = new Db('gameState.json', { exports: { setTo: true } }); | ||
resetGameState({ pointerDefault: Math.floor(Math.random() * 0x100000000) }); | ||
gameState.aaa = gameState.pointerDefault + 0xab; | ||
console.log(gameState); | ||
resetGameState({ pointerDefault: gameState.aaa }); | ||
console.log(gameState); | ||
const wordDocument = new Db('calculations.json', { saveOnChange: false, exportThis: true }); | ||
@@ -98,2 +88,2 @@ // Won't work if you destructure | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! |
7265
92
87