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 🙏

© 2025 – Pkg Stats / Ryan Hefner

knighkit-cms

v0.0.30

Published

knighkit-cms 是knighkit 的cms上传插件。

Readme

knighkit-cms 是 knighkit 的一键上传插件,也可以单独使用。可将打包好的代码,一键上传到 CMS 系统。

安装

可以使用 npm 进行安装:

	npm install -g knighkit-cms

预先安装好 phantomjs

因为网络问题,安装可能出现phantomjs下载不下来的问题。可以通过自行下载phantomjs,然后设置环境变量的方式解决。

phantomjs 的版本

推荐使用 1.9.8。

执行

创建配置文件

你需要在执行命令的文件夹中创建一个配置文件,名为 configs.js。示例内容如下:

/**
 * @describe: 所有相关配置
 */
(function (window, undefined) {
    var allConfigs = {
        /**
         * 服务器的一些固定配置
         */
        url: {
            /**
             * 服务器根地址
             */
            server: 'http://www.example.com',
            /**
             * 创建文件夹服务
             */
            newDir: '/cgi-bin/xxx?dir=',
            /**
             * 上传文件服务
             */
            upload: '/cgi-bin/xxx_new?dir=',
            /**
             * 上传html文件服务
             */
            htmlfileserver: '/edit/top.htm',
            /**
             * 修改已有旧文件的服务
             */
            htmlfileupdate: '/cgi-bin/xx/save',
            /**
             * 增加新文件的服务
             */
            htmlfileadd: '/cgi-bin/xx/add',
            /**
             * 搜索文件列表的服务
             */
            htmlfilelist: '/cgi-bin/html/search?',
            /**
             * 登陆到cms的地址
             */
            login: 'http://xxx?'
        },
        /**
         * cms频道名称
         */
        channelName: '<儿童频道>',
        /**
         * cms频道id
         */
        channelId: 'children',
        /**
         * 是否覆盖上传
         */
        overwrite: true, //是否覆盖
        /**
         *  静态资源文件过滤
         *  正则表达式
         *  正则匹配对象是整个文件路径,如:'F:\\xxxx\\xxx\\xxx-cms\\xxx\\v001\\a.js'
         */
        staticResourcesFileFilter: [/\.htm/, /\.html/],
        /**
         * 静态资源映射到服务器的规则
         * key 是 本地资源文件夹地址, 请使用绝对路径或者命令行执行位置的相对路径
         * value 是 远程服务器静态资源文件夹地址,第一个字符不能是 /,后果自负
         */
        staticResourcesMapping: {
            'F:\\xxx\\xxx\\xxx\\xxx': 'subProject/subdir/'
        },
        /**
         * 大分类,请创建测试分类,否则测试发布无法使用
         */
        catalog: 'xxxx',
        /**
         * 安全上传模式,会提示你已经存在同名文件,这时候,不能更新文件
         */
        htmlSafeAdd: false,
        /**
         * 此字段由遍历程序自动生成,请勿手动配置,无效
         * { 'filename':'filecode'
         *  }
         */
        __htmls: {},
        /**
         * 此字段由遍历程序自动生成,请勿手动配置,无效
         * { 'serverurl/sharepage/':
            { '.': [ 'F:\\xxxx\\xxx\\xxx\\xxx\\xxx\\xx.js',
                     '... ],
               V01: [ 'F:\\xxx\\xxx\\xxx\\xx.js' ]
            }
        }
         */
        __files: {}
        /* --------end-----------*/
    };

    if (typeof module !== 'undefined' && module.exports !== 'undefined') {
        module.exports = allConfigs;
    } else if (typeof define === 'function') {
        define(function () {
            return  allConfigs;
        });
    }
})(this);

执行命令

kkit -c

执行以上命令时,会自动将配置中指定的文件上传到 cms 系统。