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

sc60

v0.0.5

Published

Downloads

3

Readme

sc60

NPM version

编写软著时,总是需要复制前30页和后30页的代码,没什么技术含量还得保证刚好结尾的时候是完整的(完全不明白他们的脑回路)因此写了该脚本自动将计算每个源码的文件行数,拼接处刚好符合要求的30页+30页

安装

npm i sc60 -g

使用

在你的源码工作目录上执行以下命令

sc60

然后你就会得到两个txt文档,对应前30页和后30页的代码

Options:
  -c, --config <path>            指定配置文件路径,默认sc60.config.json
  -i, --include <include>        指定源码范围,默认为src/**/*,逗号分开
  -e, --exclude <exclude>        指定源码排除范围,逗号分开
  -n, --name <name>              指定生成的文件名,默认sc
  -t, --total-line <total-line>  指定生成的总行数,默认53*30=1590

配置

由于工作目录下有一些依赖或编译生成文件,这些不应该包含在内,因此可以自行配置:

|key|默认值|说明| |--|--|--| |name|"sc"|输出的文件名前缀| |totalLine|1590|30页的word总共要多少行代码(这个需要用户自行计算)| |include|["src/**/*"]|源代码的路径,是一个数组,glob匹配| |exlucde|['**/node_modules/**/*','dist/**/*','**/*.{png,jpg,jpeg,gif,webp,svg}','**/*.{woff,woff2,eot,ttf,otf}','**/*.{mp4,webm,ogg,mp3,wav,flac,aac,m4a}']|不会计算在内的文件, 例如node_module的依赖,图片等等|

在工作目录创建一个文件sc60.config.json,填上相关的配置:

{
  "name": "xx",
  "totalLine": 1590,
  "include": ["你的源码"],
  "exclude": ["不是源码", "的文件"]
}

License

MIT License © 2021 kkopite