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 🙏

© 2026 – Pkg Stats / Ryan Hefner

upto

v0.0.6

Published

quick init tpl

Readme

upto

作用:快速生成页面|模块

依赖:up-init脚手架生成的目录结构,使用upto快速生成页面之前,请使用up-init脚手架生成项目

安装

$ npm install upto -g

参数说明

$ -a  # 操作: 新增

$ -l  # 页面类型: 列表
$ -f  # 页面类型: 表单

$ directory | fileName 目录或者文件路径(必填)

使用示例

准备

# 创建一个文件夹,然后cd到该文件夹下
$ mkdir my-new-project && cd my-new-project

# 生成项目
$ up-init

# 新建左侧导航的独立文件
# 加入 module.exports.authList = []; 保存
$ vim ./src/layouts/CoreLayout/authList.js

# 修改 ./src/layouts/CoreLayout/CoreLayout.js的左侧导航变量
# 从authList.js导入

import authList from './authList'
<Sidebar user={ user } authList={ authList.authList }/>

使用

# 以下命令都在项目根目录下使用

# 在 /workspace 目录下增加一个名为 task 的模块
$ upto -a /workspace/task

# 在 /workspace/activity 目录下增加一个名为 ActivityAllView.js 的列表页面
$ upto -al /workspace/activity/ActivityAllView.js 

# 在 /workspace/activity 目录下增加一个名为 ActivityAddView.js 的表单页面
$ upto -af /workspace/activity/ActivityAddView.js 

效果

# src/views 下目录结构

└── workspace
    ├── activity
    │   ├── ActivityAddView.js
    │   ├── ActivityAllView.js
    │   └── modules
    │       ├── ActivityAddBlock.js
    │       ├── ActivityAllListBlock.js
    │       └── ActivityAllQueryBlock.js
    └── task
        ├── TaskAddView.js
        ├── TaskEditView.js
        ├── TaskListView.js
        └── modules
            ├── TaskAddBlock.js
            ├── TaskEditBlock.js
            ├── TaskListBlock.js
            └── TaskQueryBlock.js

# src/routes/index.js

import ActivityAllView from '../views/workspace/activity/ActivityAllView'
import ActivityAddView from '../views/workspace/activity/ActivityAddView'
import TaskEditView from '../views/workspace/task/TaskEditView'
import TaskAddView from '../views/workspace/task/TaskAddView'
import TaskListView from '../views/workspace/task/TaskListView'
import React from 'react'
import { Router , Route, IndexRoute, Redirect , hashHistory } from 'react-router'

import CoreLayout from '../layouts/CoreLayout/CoreLayout'


export default (
    <Router history={ hashHistory }>
        <Route path='/' component={CoreLayout}>
            <Route name='TaskEditView' path='/task/:taskId/edit' component={TaskEditView}/>
            <Route name='TaskAddView' path='/task/add' component={TaskAddView}/>
            <Route name='TaskListView' path='/task/list' component={TaskListView}/>
            <Route name='ActivityAddView' path='/activity/add' component={ActivityAddView}/>
            <Route name='ActivityAllView' path='/activity/all' component={ActivityAllView}/>
        </Route>
    </Router>
);


# src/layouts/CoreLayout/authList.js
module.exports.authList = [
{
    isCurrent : false,
    permissionName : 'activity',
    childrenMenuList : [
        {
            isCurrent : false,
            linkUrl : '/activity/all',
            permissionName : 'list'
        },

        {
            isCurrent : false,
            linkUrl : '/activity/add',
            permissionName : 'add'
        }
    ]
},

{
    isCurrent : false,
    permissionName : 'task',
    childrenMenuList : [
        {
            isCurrent : false,
            linkUrl : '/task/list',
            permissionName : 'list'
        },{
            isCurrent : false,  
            linkUrl : '/task/add',
            permissionName : 'add'
        },{
            isCurrent : false,
            linkUrl : '/task/0/edit',
            permissionName : 'edit'
        }
    ]
}

];

模板暂时没有配好,所以只显示了空白的页面~