ccjudge
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

ccjudge

ServerSide cross judgement of Client request information for Client-Hints and User-Agent

Installation

npm i ccjudge

Usage

import { judgeIsMobile } from 'ccjudge';
 
/**
 * @NOTE
 * Req can be substituted if it is of type `IncomingMessage` or an overlap of it.
 */
const legacyUA = req.headers['user-agent'];
const CHUAM = req.headers['sec-ch-ua-mobile'];
 
const isMobile = judgeIsMobile(legacyUA, CHUAM);
 
/** Use isMobile logics */
// ...

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    1
  • 0.1.0
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i ccjudge

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

3.48 kB

Total Files

5

Last publish

Collaborators

  • uruha