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

ctools

v2019.5.19-1

Published

> A js command tool

Downloads

23

Readme

ctools

A js command tool

How to use

# install ctools
npm install ctools -g

# 拉取仓库代码
cdevtools getDemo
cd ./vue-dev-tool
npm run appExpress
然后再浏览器打开: http://localhost:9898/platform/#/devs

# ctools push // git自动提交代码
 ## dev push 当前分支为dev分支
 push // 发布 npm 包 // 需先登陆
 push --push // 将dev 分支推送到远程同名分支 ,并发布npm包
 push --not-publish // 将dev 分支推送到远程同名分支 ,不发布npm包

 ## issues branch push 当前分支为其他分支 // 同时会拉取 test分支的代码
 push // 将代码推送到远程同名分支
 push --todev // 将代码推送到远程同名分支, 然后检出dev 将 issues 分支合并到dev
 push --publish // 将代码推送到远程同名分支, 然后检出dev 将 issues 分支合并到dev 并发布npm 包

# ctools read 将单文件拆分成多个文件, 使用场景 用单文件形式开发多文件的项目(小程序,4 个文件)(react 4 个文件)
    to split a file into several file. you can use in you react project; (
        you can edit a html file which includes script and css codes
        than use ctools to split it into css and js
    )
    you should put a ctools.config.js in you root directory;

    const weConf = {
      readType: "single file", // you'd better not change this, otherwise it will work unexpectedly
      // file type you wanna output ,  if you wanna css codes tobe a .css file than a .wxss file, just set fileType.css as css;
      fileType: {
        html: "wxml",
        css: "wxss",
        js: "js",
        json: "json"
      },
      // the directory where includes you own codes
      inputPath: ["./src/tools",],
      // the directory where you expect to place the output files
      outputPath: "./src/dist",
      // file should be go through when it's' name matches the RegExp,
      fileReg: /\.(cwx)$/,
      succMsg: "write sss success!",
    }
    module.exports = [
      // jsToolConf,
      // nodeToolConf
      weConf,
    ];

    eg. index.cwx
        <!-- you'd better use the same tag with attributes as i do -->
        <!-- because it matches tags by only a few strings below -->
        <!--
          eg. if you wanna match a .json file
          it will work when you use '<script role="json"> something </script>'
          but '<script role="json" ref="sss"> something </script>'  , '<script  role="json"> something </script>'
        -->
        <script role="json">
          /* this will output something as .json file */
          /* json.stringify( eval(the content 'export default' exports) ) */
          export default {
            aaa: "5646",
          }
        </script>
        <template>
          <!-- this will output something as .html file -->
          <div>45646</div>
        </template>
        <script>
            /* this will output something as .js file */
          Component({
            a: "43246"
          })
        </script>
        <style>
          /* this will output something as .css file */
          div{
            background-color: red;
          }
        </style>

    output:
     index.wxml
        <div>45646</div>
     index.wxss
         div{
             background-color: red;
           }
      music.js
        Component({
            a: "43246"
          })
      index.json
        {"aaa": "5646"}




    another way to use ctools read;

    i suppose there is a project like this;
    -src
      -component
        -header.vue
        -content.vue
        -footer.vue
      -views
        -index.vue

     if you wanna use all components in index.vue;
     you shall add these code in it:
        export header from "../component/header.vue"
        export content from "../component/content.vue"
        export footer from "../component/footer.vue"

     const componentConf = {
       inputPath: ["./src/component",],
       outputPath: "./src/component.js",
       fileReg: /\.(vue)$/,
       importReg: /\/src/,
       exportReg: ".",
       succMsg: "write es6 success!",
       exportMode: "es6",
     }
     how to set these params?;
     if fileReg match noting;
     export ./src/component/footer.vue;
     but it should be ../component/footer.vue;
     "./src/component/footer.vue".replace(/\/src/, ".") is "../component/footer.vue";

     then
        your codes changes to this
        export component from "../component.js";

      if you wanna those codes like this
        const header = require("../xxx/xxxx")
      just change exportMode "es6" to "node";