New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chai-ip

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-ip

Extend Chai Assertion library with tests for ip addresses

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

chai-ip

Travis npm package Coverage Status

ip address testing with Chai assertions.

Features

  • esm module only, support node >= 16 and modern browsers
  • chai expect and should interfaces

Install

$ npm install chai-ip

Plugin

import { use } from 'chai';
import ip from 'chai-ip';

use(ip);

Assertions

.ip

Assert that a string represents valid ip address.

expect('127.0.0.1').to.be.an.ip;
expect('2001:0db8:85a3:0000:0000:8a2e:0370:7334').to.be.an.ip;

.ipv4

Assert that a string represents valid ipv4 address.

expect('127.0.0.1').to.be.an.ipv4;
expect('2001:0db8:85a3:0000:0000:8a2e:0370:7334').to.not.be.an.ipv4;

.ipv6

Assert that a string represents valid ipv6 address.

expect('127.0.0.1').to.not.be.an.ipv6;
expect('2001:0db8:85a3:0000:0000:8a2e:0370:7334').to.be.an.ipv6;

License

See the LICENSE file for license rights and limitations (MIT).

Keywords

FAQs

Package last updated on 09 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc