Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add coverage #2

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading