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

lofter-pm2

v1.3.1

Published

lofter pm2 快速部署

Downloads

3

Readme

lofter-pm2

简化lofter启动pm2服务时的配置,解决overmind环境中同一pm2应用可能会被分配到同一台机器导致应用之间互相关闭的问题。

目录

使用方法

使用 CLI

启动服务

lofter-pm2 start test/server/index.js
lofter-pm2 start 支持的参数

|参数名|参数描述|默认值|参数值| |--|--|--|--| |mode|运行方式|development|development|production| |name|自定义服务名称|node-server|| |rootDir|运行的目录|当前命令运行的目录||

启动服务同时附带服务需要的参数
lofter-pm2 start test/server/index.js -- --yourKey=yourValue

暂停服务

lofter-pm2 stop test/server/index.js
lofter-pm2 stop 支持的参数

|参数名|参数描述|默认值|参数值| |--|--|--|--| |rootDir|运行的目录|当前命令运行的目录||

查看服务

lofter-pm2 status test/server/index.js
lofter-pm2 status 支持的参数

|参数名|参数描述|默认值|参数值| |--|--|--|--| |rootDir|运行的目录|当前命令运行的目录||

使用 JS API

const lofterPM2 = require('lofter-pm2');

lofterPM2.start({
  mode: 'development', // 可选, development or production, 默认 development
  name: 'server-name', // 可选
  rootDir: process.cwd(), // 可选,默认为命令运行的文件夹
  script: './server/index.js', // 必填,运行的js文件地址,相对于 rootDir
  argv: ['--yourKey','yourValue'] // 可选,附带服务需要的参数
})

lofterPM2.stop({
  rootDir: process.cwd(), // 可选,默认为命令运行的文件夹
  script: './server/index.js', // 必填,运行的js文件地址,相对于 rootDir
})

lofterPM2.status({
  rootDir: process.cwd(), // 可选,默认为命令运行的文件夹
  script: './server/index.js', // 必填,运行的js文件地址,相对于 rootDir
})

生成文件一览

  1. 输出的日志文件:'{rootDir}/logs/*.log'
  2. 记录运行中服务名: script同级的.running-server-name