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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ayxargs

v1.0.6

Published

a weak xargs tool in Node.js

Downloads

20

Readme

ayxargs - a weak xargs tool in Node.js

1. Code

所有的代码都在 ayxargs 文件中,js 文件

2. 测试用例

  1. test文件夹中有多个 .js 文件,测试脚本:ls *.js | ayxargs -n 3 wc -lls *.js | ayxargs wc -l 分别测试使用参数 n 和不使用参数 n 的两种情况。

  2. 测试脚本:echo {0..4} | ayxargs -n 2 echo ,与上面类似,测试数据只包含数字。

  3. 测试脚本:cat README.md | ayxargs -n 2,测试对特殊字符的支持情况。特殊字符包括 ``、 |、 #、 \、 @$%^&*()` ""

3. 功能实现情况

  1. 实现了 xargs 不处理 \、'、" 三个符号的feature

  2. 实现了参数 n 的题目要求

  3. 未实现 Bonus 参数 p

4. 时间情况

  1. 4 小时:入门 node.js,过了一遍新手教程和官方文档

  2. 1 小时:编码实现,大部分时间是在 Google 和 Stack Overflow 里翻阅遇到的问题和寻找可用的 library

  3. 2 小时:测试改进,测试过程中发现测试用例3中的特殊字符需要特殊处理,查找解决方案和了解 xargs 的 feature 花了比较多时间

  4. 0.5 小时:完善文档,上传 npm

5. 已知问题

  1. 异常处理非常差,没有找到合适的处理机制,还在思考。

  2. 参数 p 没有实现,node.js 的并发还没弄明白,还需要进一步思考。