typicaljoe / taffydb

TaffyDB - an open source JavaScript Database for your browser
http://taffydb.com
MIT License
2.21k stars 285 forks source link

TypeError: TAFFY is not a function #175

Closed WathikAhmed closed 2 years ago

WathikAhmed commented 2 years ago

Code

TAFFY = require("taffy").taffy;

var product_db = TAFFY([
  { item: 1, name: "Blue Ray Player", price: 99.99 },
  { item: 2, name: "3D TV", price: 1799.99 },
]);

Error

var product_db = TAFFY([
                 ^

TypeError: TAFFY is not a function
    at Object.<anonymous> (D:\Desktop 2\GITHUB\nodejs-express\dbSystem.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
mmikowski commented 2 years ago

Can you share more about your system? What execution environment are you using? Can you provide a plan so we can reproduce the issue quickly and accurately? For example, install NodeJs 12.x or node-express xx.x, then something else, then run this command. You have some of that already, but not enough to easily reproduce the issue.

WathikAhmed commented 2 years ago

Im quite new. I just did: npm init -y I have v12.18.4 of Node. to run the file of code, just node fileName I had to quickly get something working so I just switched to stormdb and seems to work fine for me. Thanks