3rd-Eden / useragent

Useragent parser for Node.js, ported from browserscope.org
MIT License
899 stars 135 forks source link

Class constructor LRUCache cannot be invoked without 'new' #171

Open GuilhermeSantos001 opened 2 years ago

GuilhermeSantos001 commented 2 years ago

The way to invoke an instance of LRUCache has changed.

GuilhermeSantos001 commented 2 years ago

var LRU = require('lru-cache') , options = { max: 5000 , length: function (n, key) { return n 2 + key.length } , dispose: function (key, n) { n.close() } , maxAge: 1000 60 * 60 } , cache = new LRU(options);

IPRIT commented 2 years ago

Any updates? This problem still doesn't allow using the module. Either mark the module deprecated, or pay attention to the PRs.

GuilhermeSantos001 commented 2 years ago

Any updates? This problem still doesn't allow using the module. Either mark the module deprecated, or pay attention to the PRs.

I am using the module and it is normal. Check the version you are using.

const device = require('express-device');
const useragent = require('useragent');

app.use(device.capture({
    parseUserAgent: true
})), useragent(true);