A Google Drive spreadsheet simple database. Stop wasting your time when a simple table is enough. Perfect for collaboration with multiple people editing the same spreadsheet.
Becomes a JSON file and an array of objects in your code:
To access it with the default configuration you just need to provide the Google Drive's sheet id. Read more in the full documentation, but here's an example:
// Include the module and tell it which spreadsheet to usevar drive = "1BfDC-ryuqahvAVKFpu21KytkBWsFDSV4clNex4F1AXc";// Load the spreadsheetdrive;
db.find() queries are the same as in mongoDB's comparison query operators:
// Return an array with one element that has the id 3db;// Return an array of people called "John" or "Jack"db;
npm install drive-db --save
To get the right Google Drive spreadsheet:
Create a Google Spreadsheet
File > Publish to the Web > Publish
Copy the id between
/edit in the url:
Use this with the module in any of the following ways:
// Single argument can be passed as that'1fvz34wY6phWDJsuIneqvOoZRPfo6CfJyPg1BYgHt59k';// If you want to add more optionssheet: '1fvz34wY6phWDJsuIneqvOoZRPfo6CfJyPg1BYgHt59k' ;// Load it later onvar drive = ;drivesheet = '1BfDC-ryuqahvAVKFpu21KytkBWsFDSV4clNex4F1AXc';
The table has to have a structure similar to this, where the first row are the alphanumeric field names:
See this document as an example. Please do not request access to edit it.
To run the tests, simply call:
Please take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Areas where I'm seeking for help: