3rd-Eden / useragent

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

Request Package is required for auto-updates, request is now deprecated #168

Open Portur opened 3 years ago

Portur commented 3 years ago

Hi,

This module uses request to auto update, however the package is now deprecated.

The solution would be to use axios

Axios has similar syntax and uses native promises.

eg.

axios( 'url', { param_one : 1, param2 : true } )
    .then( result )
    .catch( e )
kingyue737 commented 2 years ago

I made a fork https://github.com/kingyue737/useragent/commits/master to replace request with axios as NPM WARN is really annoying. Also update the outdated regexp list. You can override the original dependency if you are using pnpm:

// package.json
{
  "pnpm": {
    "overrides": {
      "useragent": "npm:@kingyue/useragent@^2.4.0"
    }
  }
}
reorx commented 1 year ago

@kingyue737 the npm warn disappears, thanks for your great work!