I have faced a very simple problem. I want to use a pakcage named Rbush in my javascript script in nodejs.
I have installed it using npm install rbush command and when I try to use it It raises this error
ReferenceError: RBush is not defined
here is my code
const t=require('rbush');
const tree = new RBush();
const item = {
minX: 20,
minY: 40,
maxX: 30,
maxY: 50,
foo: 'bar'
};
tree.insert(item);
I know that I have to include it into my script and I have done that using require function but it seems that it does not add the library there.I also tried the following method but it still does not work.
const tree=require('rbush');
const item = {
minX: 20,
minY: 40,
maxX: 30,
maxY: 50,
foo: 'bar'
};
tree.insert(item);