Socket
Socket
Sign inDemoInstall

isbot

Package Overview
Dependencies
0
Maintainers
2
Versions
125
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.0 to 3.7.1-deprecated

1

index.d.ts

@@ -18,2 +18,3 @@ /**

* Removes a set of user agent from the built-in list
* This function requires konwnledge of the internal structure of the list - which may change at any time. It is recommended to use the `clear` function instead
* @param {string[]} filters An array of regular expression patterns

@@ -20,0 +21,0 @@ * @returns {void}

326

index.iife.js
var isbot = (function () {
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : String(i);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _classPrivateFieldGet(receiver, privateMap) {

@@ -166,3 +265,2 @@ var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");

"freesafeip",
"ghost",
"gomezagent",

@@ -177,2 +275,3 @@ "google",

"images",
"inspect",
"iplabel",

@@ -218,3 +317,2 @@ "ips-agent",

"synthetic",
"taginspector/",
"torrent",

@@ -259,5 +357,7 @@ "tracemyfile",

// Addresses: Yandex Search App
['search', '(?<! ya(?:yandex)?)search']].forEach(_ref => {
let [search, replace] = _ref;
const index = list.lastIndexOf(search);
['search', '(?<! ya(?:yandex)?)search']].forEach(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
search = _ref2[0],
replace = _ref2[1];
var index = list.lastIndexOf(search);
if (~index) {

@@ -271,3 +371,3 @@ list.splice(index, 1, replace);

amend(list);
const flags = 'i';
var flags = 'i';

@@ -281,4 +381,6 @@ /**

var _index = /*#__PURE__*/new WeakSet();
class Isbot {
constructor(patterns) {
var Isbot = /*#__PURE__*/function () {
function Isbot(patterns) {
var _this = this;
_classCallCheck(this, Isbot);
/**

@@ -310,18 +412,20 @@ * Find the first index of an existing rule or -1 if not found

_classPrivateMethodGet(this, _update, _update2).call(this);
const isbot = ua => this.test(ua);
return Object.defineProperties(isbot, Object.entries(Object.getOwnPropertyDescriptors(Isbot.prototype)).reduce((accumulator, _ref) => {
let [prop, descriptor] = _ref;
var isbot = function isbot(ua) {
return _this.test(ua);
};
return Object.defineProperties(isbot, Object.entries(Object.getOwnPropertyDescriptors(Isbot.prototype)).reduce(function (accumulator, _ref) {
var _ref2 = _slicedToArray(_ref, 2),
prop = _ref2[0],
descriptor = _ref2[1];
if (typeof descriptor.value === 'function') {
Object.assign(accumulator, {
[prop]: {
value: this[prop].bind(this)
}
});
Object.assign(accumulator, _defineProperty({}, prop, {
value: _this[prop].bind(_this)
}));
}
if (typeof descriptor.get === 'function') {
Object.assign(accumulator, {
[prop]: {
get: () => this[prop]
Object.assign(accumulator, _defineProperty({}, prop, {
get: function get() {
return _this[prop];
}
});
}));
}

@@ -331,89 +435,113 @@ return accumulator;

}
/**
* Get a clone of the pattern
* @type RegExp
*/
get pattern() {
return new RegExp(_classPrivateFieldGet(this, _pattern));
}
_createClass(Isbot, [{
key: "pattern",
get:
/**
* Get a clone of the pattern
* @type RegExp
*/
function get() {
return new RegExp(_classPrivateFieldGet(this, _pattern));
}
/**
* Match given string against out pattern
* @param {string} ua User Agent string
* @returns {boolean}
*/
test(ua) {
return Boolean(ua) && _classPrivateFieldGet(this, _pattern).test(ua);
}
/**
* Match given string against out pattern
* @param {string} ua User Agent string
* @returns {boolean}
*/
}, {
key: "test",
value: function test(ua) {
return Boolean(ua) && _classPrivateFieldGet(this, _pattern).test(ua);
}
/**
* Get the match for strings' known crawler pattern
* @param {string} ua User Agent string
* @returns {string|null}
*/
find() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
const match = ua.match(_classPrivateFieldGet(this, _pattern));
return match && match[0];
}
/**
* Get the match for strings' known crawler pattern
* @param {string} ua User Agent string
* @returns {string|null}
*/
}, {
key: "find",
value: function find() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var match = ua.match(_classPrivateFieldGet(this, _pattern));
return match && match[0];
}
/**
* Get the patterns that match user agent string if any
* @param {string} ua User Agent string
* @returns {string[]}
*/
matches() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return _classPrivateFieldGet(this, _list).filter(entry => new RegExp(entry, flags).test(ua));
}
/**
* Get the patterns that match user agent string if any
* @param {string} ua User Agent string
* @returns {string[]}
*/
}, {
key: "matches",
value: function matches() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return _classPrivateFieldGet(this, _list).filter(function (entry) {
return new RegExp(entry, flags).test(ua);
});
}
/**
* Clear all patterns that match user agent
* @param {string} ua User Agent string
* @returns {void}
*/
clear() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
this.exclude(this.matches(ua));
}
/**
* Clear all patterns that match user agent
* @param {string} ua User Agent string
* @returns {void}
*/
}, {
key: "clear",
value: function clear() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
this.exclude(this.matches(ua));
}
/**
* Extent patterns for known crawlers
* @param {string[]} filters
* @returns {void}
*/
extend() {
let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
[].push.apply(_classPrivateFieldGet(this, _list), filters.filter(rule => _classPrivateMethodGet(this, _index, _index2).call(this, rule) === -1).map(filter => filter.toLowerCase()));
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Extent patterns for known crawlers
* @param {string[]} filters
* @returns {void}
*/
}, {
key: "extend",
value: function extend() {
var _this2 = this;
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
[].push.apply(_classPrivateFieldGet(this, _list), filters.filter(function (rule) {
return _classPrivateMethodGet(_this2, _index, _index2).call(_this2, rule) === -1;
}).map(function (filter) {
return filter.toLowerCase();
}));
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Exclude patterns from bot pattern rule
* @param {string[]} filters
* @returns {void}
*/
exclude() {
let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let {
length
} = filters;
while (length--) {
const index = _classPrivateMethodGet(this, _index, _index2).call(this, filters[length]);
if (index > -1) {
_classPrivateFieldGet(this, _list).splice(index, 1);
/**
* Exclude patterns from bot pattern rule
* @param {string[]} filters
* @returns {void}
*/
}, {
key: "exclude",
value: function exclude() {
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var length = filters.length;
while (length--) {
var index = _classPrivateMethodGet(this, _index, _index2).call(this, filters[length]);
if (index > -1) {
_classPrivateFieldGet(this, _list).splice(index, 1);
}
}
_classPrivateMethodGet(this, _update, _update2).call(this);
}
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Create a new Isbot instance using given list or self's list
* @param {string[]} [list]
* @returns {Isbot}
*/
spawn(list) {
return new Isbot(list || _classPrivateFieldGet(this, _list));
}
}
/**
* Create a new Isbot instance using given list or self's list
* @param {string[]} [list]
* @returns {Isbot}
*/
}, {
key: "spawn",
value: function spawn(list) {
return new Isbot(list || _classPrivateFieldGet(this, _list));
}
}]);
return Isbot;
}();
function _update2() {

@@ -426,3 +554,3 @@ _classPrivateFieldSet(this, _pattern, new RegExp(_classPrivateFieldGet(this, _list).join('|'), flags));

const isbot = new Isbot();
var isbot = new Isbot();

@@ -429,0 +557,0 @@ return isbot;

@@ -0,1 +1,100 @@

function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : String(i);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _classPrivateFieldGet(receiver, privateMap) {

@@ -164,3 +263,2 @@ var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get");

"freesafeip",
"ghost",
"gomezagent",

@@ -175,2 +273,3 @@ "google",

"images",
"inspect",
"iplabel",

@@ -216,3 +315,2 @@ "ips-agent",

"synthetic",
"taginspector/",
"torrent",

@@ -257,5 +355,7 @@ "tracemyfile",

// Addresses: Yandex Search App
['search', '(?<! ya(?:yandex)?)search']].forEach(_ref => {
let [search, replace] = _ref;
const index = list.lastIndexOf(search);
['search', '(?<! ya(?:yandex)?)search']].forEach(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
search = _ref2[0],
replace = _ref2[1];
var index = list.lastIndexOf(search);
if (~index) {

@@ -269,3 +369,3 @@ list.splice(index, 1, replace);

amend(list);
const flags = 'i';
var flags = 'i';

@@ -279,4 +379,6 @@ /**

var _index = /*#__PURE__*/new WeakSet();
class Isbot {
constructor(patterns) {
var Isbot = /*#__PURE__*/function () {
function Isbot(patterns) {
var _this = this;
_classCallCheck(this, Isbot);
/**

@@ -308,18 +410,20 @@ * Find the first index of an existing rule or -1 if not found

_classPrivateMethodGet(this, _update, _update2).call(this);
const isbot = ua => this.test(ua);
return Object.defineProperties(isbot, Object.entries(Object.getOwnPropertyDescriptors(Isbot.prototype)).reduce((accumulator, _ref) => {
let [prop, descriptor] = _ref;
var isbot = function isbot(ua) {
return _this.test(ua);
};
return Object.defineProperties(isbot, Object.entries(Object.getOwnPropertyDescriptors(Isbot.prototype)).reduce(function (accumulator, _ref) {
var _ref2 = _slicedToArray(_ref, 2),
prop = _ref2[0],
descriptor = _ref2[1];
if (typeof descriptor.value === 'function') {
Object.assign(accumulator, {
[prop]: {
value: this[prop].bind(this)
}
});
Object.assign(accumulator, _defineProperty({}, prop, {
value: _this[prop].bind(_this)
}));
}
if (typeof descriptor.get === 'function') {
Object.assign(accumulator, {
[prop]: {
get: () => this[prop]
Object.assign(accumulator, _defineProperty({}, prop, {
get: function get() {
return _this[prop];
}
});
}));
}

@@ -329,89 +433,113 @@ return accumulator;

}
/**
* Get a clone of the pattern
* @type RegExp
*/
get pattern() {
return new RegExp(_classPrivateFieldGet(this, _pattern));
}
_createClass(Isbot, [{
key: "pattern",
get:
/**
* Get a clone of the pattern
* @type RegExp
*/
function get() {
return new RegExp(_classPrivateFieldGet(this, _pattern));
}
/**
* Match given string against out pattern
* @param {string} ua User Agent string
* @returns {boolean}
*/
test(ua) {
return Boolean(ua) && _classPrivateFieldGet(this, _pattern).test(ua);
}
/**
* Match given string against out pattern
* @param {string} ua User Agent string
* @returns {boolean}
*/
}, {
key: "test",
value: function test(ua) {
return Boolean(ua) && _classPrivateFieldGet(this, _pattern).test(ua);
}
/**
* Get the match for strings' known crawler pattern
* @param {string} ua User Agent string
* @returns {string|null}
*/
find() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
const match = ua.match(_classPrivateFieldGet(this, _pattern));
return match && match[0];
}
/**
* Get the match for strings' known crawler pattern
* @param {string} ua User Agent string
* @returns {string|null}
*/
}, {
key: "find",
value: function find() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var match = ua.match(_classPrivateFieldGet(this, _pattern));
return match && match[0];
}
/**
* Get the patterns that match user agent string if any
* @param {string} ua User Agent string
* @returns {string[]}
*/
matches() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return _classPrivateFieldGet(this, _list).filter(entry => new RegExp(entry, flags).test(ua));
}
/**
* Get the patterns that match user agent string if any
* @param {string} ua User Agent string
* @returns {string[]}
*/
}, {
key: "matches",
value: function matches() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return _classPrivateFieldGet(this, _list).filter(function (entry) {
return new RegExp(entry, flags).test(ua);
});
}
/**
* Clear all patterns that match user agent
* @param {string} ua User Agent string
* @returns {void}
*/
clear() {
let ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
this.exclude(this.matches(ua));
}
/**
* Clear all patterns that match user agent
* @param {string} ua User Agent string
* @returns {void}
*/
}, {
key: "clear",
value: function clear() {
var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
this.exclude(this.matches(ua));
}
/**
* Extent patterns for known crawlers
* @param {string[]} filters
* @returns {void}
*/
extend() {
let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
[].push.apply(_classPrivateFieldGet(this, _list), filters.filter(rule => _classPrivateMethodGet(this, _index, _index2).call(this, rule) === -1).map(filter => filter.toLowerCase()));
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Extent patterns for known crawlers
* @param {string[]} filters
* @returns {void}
*/
}, {
key: "extend",
value: function extend() {
var _this2 = this;
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
[].push.apply(_classPrivateFieldGet(this, _list), filters.filter(function (rule) {
return _classPrivateMethodGet(_this2, _index, _index2).call(_this2, rule) === -1;
}).map(function (filter) {
return filter.toLowerCase();
}));
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Exclude patterns from bot pattern rule
* @param {string[]} filters
* @returns {void}
*/
exclude() {
let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let {
length
} = filters;
while (length--) {
const index = _classPrivateMethodGet(this, _index, _index2).call(this, filters[length]);
if (index > -1) {
_classPrivateFieldGet(this, _list).splice(index, 1);
/**
* Exclude patterns from bot pattern rule
* @param {string[]} filters
* @returns {void}
*/
}, {
key: "exclude",
value: function exclude() {
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var length = filters.length;
while (length--) {
var index = _classPrivateMethodGet(this, _index, _index2).call(this, filters[length]);
if (index > -1) {
_classPrivateFieldGet(this, _list).splice(index, 1);
}
}
_classPrivateMethodGet(this, _update, _update2).call(this);
}
_classPrivateMethodGet(this, _update, _update2).call(this);
}
/**
* Create a new Isbot instance using given list or self's list
* @param {string[]} [list]
* @returns {Isbot}
*/
spawn(list) {
return new Isbot(list || _classPrivateFieldGet(this, _list));
}
}
/**
* Create a new Isbot instance using given list or self's list
* @param {string[]} [list]
* @returns {Isbot}
*/
}, {
key: "spawn",
value: function spawn(list) {
return new Isbot(list || _classPrivateFieldGet(this, _list));
}
}]);
return Isbot;
}();
function _update2() {

@@ -424,5 +552,5 @@ _classPrivateFieldSet(this, _pattern, new RegExp(_classPrivateFieldGet(this, _list).join('|'), flags));

const isbot = new Isbot();
var isbot = new Isbot();
module.exports = isbot;
//# sourceMappingURL=index.js.map
{
"name": "isbot",
"version": "3.7.0",
"version": "3.7.1-deprecated",
"description": "🤖 detect bots/crawlers/spiders via the user agent.",

@@ -5,0 +5,0 @@ "keywords": [

# isbot 🤖/👨‍🦰
[![](https://img.shields.io/npm/v/isbot.svg?style=flat-square)](https://www.npmjs.com/package/isbot) [![](https://img.shields.io/npm/dt/isbot?style=flat-square)](https://www.npmjs.com/package/isbot) [![](https://img.shields.io/circleci/build/github/omrilotan/isbot?style=flat-square)](https://circleci.com/gh/omrilotan/isbot) [![](https://img.shields.io/github/last-commit/omrilotan/isbot?style=flat-square)](https://github.com/omrilotan/isbot/graphs/commit-activity) [![](https://badgen.net/discord/online-members/yzRmGaDH?icon=discord&label=&style=flat-square)](https://discord.gg/yzRmGaDH)
[![](https://img.shields.io/npm/v/isbot.svg?style=flat-square)](https://www.npmjs.com/package/isbot) [![](https://img.shields.io/npm/dt/isbot?style=flat-square)](https://www.npmjs.com/package/isbot) [![](https://img.shields.io/circleci/build/github/omrilotan/isbot?style=flat-square)](https://circleci.com/gh/omrilotan/isbot) [![](https://img.shields.io/github/last-commit/omrilotan/isbot?style=flat-square)](https://github.com/omrilotan/isbot/graphs/commit-activity) [![](https://data.jsdelivr.com/v1/package/npm/isbot/badge)](https://www.jsdelivr.com/package/npm/isbot)

@@ -9,2 +9,13 @@ [![](./page/isbot.svg)](https://isbot.js.org)

> ## Releasing Version 4: deprecation notice
>
> ### Version 4 will become the "latest" version on npm on January 2024
>
> `npm i isbot@4` or `npm i isbot@next`
>
> I'll be releasing version 4 as "latest" soon. Migration is simple, just replace `import isbot from "isbot"` with `import { isbot } from "isbot"` in your code.
>
> If you are using extended functionality, there will be more changes and the feature you're using is no longer supported as is. Please open an issue if you need help migrating.
> Please visit [isbot](https://isbot.js.org) for more information.
## Usage

@@ -30,4 +41,7 @@

Using JSDeliver CDN you can import an iife script
> See specific versions https://www.jsdelivr.com/package/npm/isbot or https://cdn.jsdelivr.net/npm/isbot
```html
<script src="https://cdn.jsdelivr.net/npm/isbot/index.iife.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/isbot@3"></script>
// isbot is global

@@ -54,2 +68,4 @@ isbot(navigator.userAgent)

> This function requires konwnledge of the internal structure of the list - which may change at any time. It is recommended to use the `clear` function instead
```js

@@ -56,0 +72,0 @@ isbot('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Safari/537.36 Chrome-Lighthouse') // true

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc