npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

networkcalc

v1.0.0

Published

Conversion of commonly used units on the internet

Readme

网络常用单位转换使用示例

NetWorkCalc

1. KB 转换为 Bytes

const bytes = netWorkCalc.kbToBytes(5000);
console.log(`5000 KB = ${bytes} Bytes`);  // 输出: 5000000 Bytes

2. KB 转换为 MB

const mb = netWorkCalc.kbToMB(5000);
console.log(`5000 KB = ${mb} MB`);  // 输出: 5 MB

3. KB 转换为 GB

const gb = netWorkCalc.kbToGB(5000000);
console.log(`5000000 KB = ${gb} GB`);  // 输出: 5 GB

4. KB 转换为 TB

const tb = netWorkCalc.kbToTB(5000000000);
console.log(`5000000000 KB = ${tb} TB`);  // 输出: 5 TB

5. KB 转换为 PB

const pb = netWorkCalc.kbToPB(5000000000000);
console.log(`5000000000000 KB = ${pb} PB`);  // 输出: 5 PB

6. KB 转换为 EB

const eb = netWorkCalc.kbToEB(5000000000000000);
console.log(`5000000000000000 KB = ${eb} EB`);  // 输出: 5 EB

7. KB 转换为 ZB

const zb = netWorkCalc.kbToZB(5000000000000000000);
console.log(`5000000000000000000 KB = ${zb} ZB`);  // 输出: 5 ZB

8. KB 转换为 YB

const yb = netWorkCalc.kbToYB(5000000000000000000000);
console.log(`5000000000000000000000 KB = ${yb} YB`);  // 输出: 5 YB

9. MB 转换为 Bytes

const bytes = netWorkCalc.mbToBytes(500);
console.log(`500 MB = ${bytes} Bytes`);  // 输出: 500000000 Bytes

10. MB 转换为 KB

const kb = netWorkCalc.mbToKB(500);
console.log(`500 MB = ${kb} KB`);  // 输出: 500000 KB

11. MB 转换为 GB

const gb = netWorkCalc.mbToGB(500000);
console.log(`500000 MB = ${gb} GB`);  // 输出: 500 GB

12. MB 转换为 TB

const tb = netWorkCalc.mbToTB(500000000);
console.log(`500000000 MB = ${tb} TB`);  // 输出: 500 TB

13. MB 转换为 PB

const pb = netWorkCalc.mbToPB(500000000000);
console.log(`500000000000 MB = ${pb} PB`);  // 输出: 500 PB

14. MB 转换为 EB

const eb = netWorkCalc.mbToEB(500000000000000);
console.log(`500000000000000 MB = ${eb} EB`);  // 输出: 500 EB

15. MB 转换为 ZB

const zb = netWorkCalc.mbToZB(500000000000000000);
console.log(`500000000000000000 MB = ${zb} ZB`);  // 输出: 500 ZB

16. MB 转换为 YB

const yb = netWorkCalc.mbToYB(500000000000000000000);
console.log(`500000000000000000000 MB = ${yb} YB`);  // 输出: 500 YB

17. GB 转换为 Bytes

const bytes = netWorkCalc.gbToBytes(500);
console.log(`500 GB = ${bytes} Bytes`);  // 输出: 500000000000 Bytes

18. GB 转换为 KB

const kb = netWorkCalc.gbToKB(500);
console.log(`500 GB = ${kb} KB`);  // 输出: 500000000 KB

19. GB 转换为 MB

const mb = netWorkCalc.gbToMB(500);
console.log(`500 GB = ${mb} MB`);  // 输出: 500000 MB

20. GB 转换为 TB

const tb = netWorkCalc.gbToTB(500000);
console.log(`500000 GB = ${tb} TB`);  // 输出: 500 TB

21. GB 转换为 PB

const pb = netWorkCalc.gbToPB(500000000);
console.log(`500000000 GB = ${pb} PB`);  // 输出: 500 PB

22. GB 转换为 EB

const eb = netWorkCalc.gbToEB(500000000000);
console.log(`500000000000 GB = ${eb} EB`);  // 输出: 500 EB

23. GB 转换为 ZB

const zb = netWorkCalc.gbToZB(500000000000000);
console.log(`500000000000000 GB = ${zb} ZB`);  // 输出: 500 ZB

24. GB 转换为 YB

const yb = netWorkCalc.gbToYB(500000000000000000);
console.log(`500000000000000000 GB = ${yb} YB`);  // 输出: 500 YB

25. 计算下载时间

const fileSizeBytes = netWorkCalc.mbToBytes(100);  // 100 MB 转换为 Bytes
const speedBps = netWorkCalc.convertUnit(100, 'MB', 'bits');  // 100 Mbps 转换为 bps
const downloadTime = netWorkCalc.calculateDownloadTime(fileSizeBytes, speedBps);
console.log(`100 MB 文件在 100 Mbps 下的下载时间: ${downloadTime} 秒`);

26. 计算带宽延迟积 (BDP)

const bdp = netWorkCalc.calculateBDP(100000000, 0.05);  // 带宽 100 Mbps,延迟 50 毫秒
console.log(`带宽延迟积: ${bdp} bits`);

27. 毫秒转换为秒

const seconds = netWorkCalc.msToSeconds(5000);
console.log(`5000 毫秒 = ${seconds} 秒`);  // 输出: 5 秒

28. 秒转换为毫秒

const milliseconds = netWorkCalc.secondsToMs(5);
console.log(`5 秒 = ${milliseconds} 毫秒`);  // 输出: 5000 毫秒

29. 计算每秒的数据包数量

const packetsPerSecond = netWorkCalc.calculatePacketsPerSecond(1500, 1000000000);  // 数据包大小为 1500 字节,带宽为 1 Gbps
console.log(`每秒传输的数据包数量: ${packetsPerSecond}`);  // 输出: 83333.33 包/秒