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

lcq.utils

v3.1.3

Published

a lot of tools

Downloads

22

Readme

lcq.utils

一个工具集合

安装

$ npm install lcq.utils --save  // yarn add lcq.utils

使用

常用工具

import utils, { request, is, file, cli, string, network, npm } from "lcq.utils";

// is
utils.is.isElectron(); // is.isElectron()
utils.is.isWin(); // is.isWin()
utils.is.isMac(); // is.isMac()
utils.is.isLinux(); // is.isLinux()

// request
const res = await request.get("/api/v1/getUserInfo");

// file
file.open("http://baidu.com"); // 浏览器打开
file.del("/somefile"); // 删除文件
file.mkdirp('./demo')

// string
string.uuid(); // 75cb6b99-c257-41e6-b9f2-ae7ad1d31ce9
string.semver()

// network
network.normalizeUrl("baidu.com"); // => 'http://baidu.com'
await network.ping.promise.probe("127.0.0.1"); // => {alive: true, ...}
await network.getPublicNetworkIp() // => 22.33.44.55
await network.getIpV4() // => 192.168.1.2
await network.getIpV6() // =>
await network.isAt100Tal() // => true、false

// cli
cli.shell.ls("./"); // => show current dir files
console.log(cli.color.blue("this is a blue text for cli color"));

// npm
await npm.getNpmTarball("lcq.utils"); // => https://registry.npm.taobao.org/lcq.utils/download/lcq.utils-${version}.tgz
await npm.getNpmInfo("lcq.utils"); // => {name: 'lcq.utils', versions: [],....}
await npm.getLatestVersion("lcq.utils"); // => 3.0.1
...

terminal 工具

  • lcq-del 删除本地文件
$ lcq-del ./somefile
  • lcq-serve 在当前目录起一个静态服务
$ cd someDir

$ lcq-serve

->  http://localhost:5000
  • lcq-open 本地浏览器打开链接
$ lcq-open https://baidu.com
  • lcq-uuid 生成一个 uuid
$ lcq-uuid

-> 75cb6b99-c257-41e6-b9f2-ae7ad1d31ce9
  • lcq-start 在一个命令行同时运行多个命令
"scripts": {
        // ...
        "watch-js": "...",
        "watch-less": "...",
        "start": "lcq-start \"npm:watch-js\" \"npm:watch-less\""
        // ...
}

->
  • lcq-shell 跨平台的 unix 脚本执行
$ lcq-shell echo hello world

-> hello world