0.1.1 • Published 4 years ago

ccjudge v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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 */
// ...
0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago