# oneport

> 用于获取一个空闲的端口的小模块

Latest version **1.0.3** (published 2023-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install oneport
pnpm add oneport
yarn add oneport
bun add oneport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-10-29 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Houfeng |
| Maintainers | houzhanfeng |
| Keywords | port, freeport, activeport, free, active |

## Links

- npm: https://www.npmjs.com/package/oneport
- Repository: https://github.com/Houfeng/oneport
- Homepage: https://github.com/Houfeng/oneport#readme
- Issues: https://github.com/Houfeng/oneport/issues
- npm.io page: https://npm.io/package/oneport

## Dependencies (2)

- [cify](https://npm.io/package/cify.md) 2.1.1
- [ntils](https://npm.io/package/ntils.md) 2.0.3

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2023-10-29
- 1.0.2 — 2017-01-07
- 1.0.1 — 2016-10-15
- 1.0.0 — 2016-10-13

## README

# 简介
一个用于获取空闲端口的小模块

# 安装
```sh
npm install oneport --save
```

# 使用

```js


//获取一个空闲的端口
oneport.acquire(function (err, port) {
  if (err) return console.error(err);
  console.log('port:', port);
});

let guid = '3aac50f1-bdb2-44c0-3eb0-228aa48bbf3a';

//获取一个端口，并指定一个「名称」
oneport.acquire(guid, function (err, port) {
  if (err) return console.error(err);
  console.log('port:', port);
});

//通过名称查询最后一次成功获取的端口
oneport.last(guid, function (err, port) {
  if (err) return console.error(err);
  console.log('port:', port);
});

```

---
_Source: https://npm.io/package/oneport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
