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

spark-command

v1.4.6

Published

spark-command是一个命令行工具类

Downloads

71

Readme

建议版本:node >= 8.9.2

spark-command

note:

  • 快速生成mpa项目(ts-mpa-react-webpack
  • 快速爬取网站
  • 快速上传阿里云oss对象存储

各个功能,互不影响。选择你需要的功能使用

Installation

 npm install spark-command -g

控制台输入spark -v 或者 spark 版本号输出则正确安装

Requirements

  • nodejs version >= 8.9.2

Usage

  • 如何生成mpa项目?

    spark mpa

    然后就可以npm i安装依赖,一个多页面项目就可以拿去用了


  • 如何爬取网站下载到本地?

    spark web --output downloadDir --address http://www.baidu.com --recursive

    支持简写:

    spark w -o downloadDir -a http://www.baidu.com -r

    --output: 定义输出目录,简写-o

    --address: 定义爬取网址,简写-a

    --recursive: 是否开启递归爬取,简写-r

    注意:爬取网站开启递归后,可能会出现持续下载的情况,关闭递归下载,可能对你会有帮助!


  • 如何上传本地文件夹到oss对象存储?

    首先,生成配置文件oss.config.js

    spark oss --init

    填写阿里云配置和本地目录以及要上传到oss的目录

    module.exports = {
        // 阿里云配置
        ossConf: {
            accessKeyId: '',
            accessKeySecret: ''
        },
        /** 
         * 区分环境,填写配置项
         * sourcePath 本地目录
         * uploadPath 要传到oss对应的对象存储地址
         **/
        envConf: {
            // 将本地项目中./dist/javascript目录上传至bucket为test的`development/test/directory`路径下
            development: {
                region: '',
                bucket: 'test',
                sourcePath: './dist/javascript', // 要上传本地的路径,此目录最好放在此配置文件同级或下级
                uploadPath: 'development/test/directory' //oss路径
            },
            production: {
                region: '',
                bucket: '',
                sourcePath: '',
                uploadPath: ''
            },
            // 可以自定义环境,上传输入: spark oss --upload test
            test: {
                region: '',
                bucket: '',
                sourcePath: '',
                uploadPath: ''
            }
        }
    }

    配置完成后,如果想上传到development对应的oss存储,运行

    spark oss --upload developemnt

    以下指令添加后,将不再询问, 添加--backup-b会先备份uploadPath目录,再进行上传; 如果添加--yes-y将跳过备份直接上传(同名文件直接覆盖)

    spark oss --upload development --backup
    spark oss --upload development --yes

Helper

  • spark mpa -h: 获取多页面模版帮助

  • spark oss -h: 获取oss上传帮助

  • spark web -h: 获取抓取web页面帮助