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

erisl-crm-cli

v1.0.73

Published

CRM CLI Tools

Downloads

40

Readme

ERISL CRM CLI

命令

  • erisl-crm-cli init 初始化项目
  • erisl-crm-cli create 创建模板页面
  • erisl-crm-cli delete 删除模板页面
  • erisl-crm-cli dev 开发模式
  • erisl-crm-cli start 生产模式
  • erisl-crm-cli build 编译
  • erisl-crm-cli export 导出静态页面

参数

  • dictionary: 在 export/init 的时候使用, 默认 out, 譬如: erisl-crm-cli init|export dictionary=webapp 或者 erisl-crm-cli init|export webapp
  • controller: 在 create/delete 的时候使用, 必须有。譬如: erisl-crm-cli create|delete math
  • action: 在 create/delete 的时候使用, 默认 manage, 跟在 controller 后面, 譬如 erisl-crm-cli create|delete math test

根目录新增 next.config.js

const { nextConfig } = require('erisl-crm-cli')
const projectConfig = require('./project.config')

const { version, prefix, protocol, host, port } = projectConfig 

module.exports = (phase, defaultConfig) => {
    let configObj = nextConfig(phase, defaultConfig, { 
        version, prefix, protocol, host, port
    })

    return configObj
}

根目录新增 mysql.config.js

const { mysqlConfig } = require('erisl-crm-cli')
const { mysqlOptions } = mysqlConfig
const { user, password, host, port, database } = mysqlOptions

module.exports = {
    mysqlOptions: {
        user,
        password,
        host,
        port,
        database
    }
}

根目录新增 project.config.js

const { projectConfig } = require('erisl-crm-cli')

const { version, prefix, protocol, host, port } = projectConfig

module.exports = {
    version,
    prefix,
    protocol,
    host, 
    port
}

根目录新增 server

  • apis 存放 Rest Api
  • modules 存放 graphql 的 resolver 和 schema
  • plugins 存放 graphql 的 plugin
  • .js 举例: test.js => 用于响应 /test/, ${prefix}/test/* 请求
  const express = require('express')
  const moment = require('moment')

  const router = express.Router()

  router.use((req, res, next) => {
      const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
      console.log(moment().format('YYYY-MM-DD HH:mm:ss') + ' ' + fullUrl)
      next()
  })

  router.get('/*', (req, res) => {
      res.statusCode = 200
      res.json({ name: 'TEST' })
  })

  module.exports = router
  • apis/hello.js
const express = require('express')
const router = express.Router()

router.get('/*', (req, res) => {
    res.statusCode = 200
    res.json({ name: 'Hello' })
})

module.exports = router
  • modules/link/schema.js
module.exports = {
    query: `
        link: String
    `,
    mutation: `
        linkUpdate(link: Date): String
    `,
    subscription: ``,
    type: ``
} 
  • modules/link/resolver.js
let localLink = ''

module.exports = {
    link: () => {
        return localLink
    },
    linkUpdate: ({ link }) =>{
        console.log('link', link)
        localLink = link
        return localLink
    }
}
  • plugins/date.js
const moment = require('moment')
const { Kind } = require('graphql/language')
const { GraphQLScalarType } = require('graphql')

const customScalarDate = new GraphQLScalarType({
    name: 'Date',
    description: 'Date custom scalar type',
    parseValue: value => moment(value).valueOf(),
    serialize: value => moment(value).format('YYYY-MM-DD HH:mm:ss:SSS'),
    parseLiteral: ast => (ast.kind === Kind.INT)
        ? parseInt(ast.value, 10)
        : null
})

module.exports = { Date: customScalarDate }