Skip to content

Commit

Permalink
test: add coverage (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Jun 12, 2024
1 parent aa5672b commit fc37341
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 27 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
Job:
name: Node.js
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest'
version: '14, 16, 18, 20, 22'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17 changes: 0 additions & 17 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
npm-debug.log
coverage
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# IP

[![](https://badge.fury.io/js/@eggjs/ip.svg)](https://www.npmjs.com/package/@eggjs/ip)
# @eggjs/ip

[![NPM version][npm-image]][npm-url]
[![Node.js CI](https://github.com/eggjs/node-ip/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/node-ip/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/@eggjs/ip.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@eggjs/ip
[codecov-image]: https://codecov.io/gh/eggjs/node-ip/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/eggjs/node-ip
[snyk-image]: https://snyk.io/test/npm/@eggjs/ip/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/@eggjs/ip
[download-image]: https://img.shields.io/npm/dm/@eggjs/ip.svg?style=flat-square
[download-url]: https://npmjs.org/package/@eggjs/ip

IP address utilities for node.js

Expand All @@ -11,15 +24,15 @@ Security fix fork, merge https://github.com/indutny/node-ip/pull/144
### npm

```shell
npm install ip
npm install @eggjs/ip
```

## Usage

Get your ip address, compare ip addresses, validate ip addresses, etc.

```js
var ip = require('ip');
var ip = require('@eggjs/ip');

ip.address() // my ip address
ip.isEqual('::1', '::0:1'); // true
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
],
"main": "lib/ip",
"devDependencies": {
"eslint": "^8.15.0",
"mocha": "^10.0.0"
"egg-bin": "^6.10.0",
"eslint": "^8.15.0"
},
"scripts": {
"lint": "eslint lib/*.js test/*.js",
"test": "npm run lint && mocha --reporter spec test/*-test.js",
"fix": "npm run lint -- --fix"
"lint": "eslint lib test",
"test": "npm run lint && egg-bin test --ts false",
"fix": "npm run lint -- --fix",
"ci": "npm run lint && egg-bin cov --ts false"
},
"license": "MIT"
}
File renamed without changes.

0 comments on commit fc37341

Please sign in to comment.