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

nidle-plugin-nvm

v0.2.9-alpha.0

Published

nidle plugin of nvm node version manager

Downloads

34

Readme

nidle-plugin-nvm

nidle plugin of nvm node version manager,required nvm

Install

npm install nidle-plugin-nvm

Usage

如果您有多个项目,且依赖不同的 node version,那么可以使用该插件.

nidle-plugin-nvm 会根据

  • .nvmrc (优先
  • package.json > engines > node

获取应用所需的node version,并修改task.processOptions.execPath指向正确的 node 执行文件。

WHY

为什么nidle-plugin-nvm不直接nvm use管理应用的 node 版本,而是只给出执行文件路径?

nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell.

先看nvm官方原文,nvm的版本管理在多个shell脚本中是互相独立的;

我们的插件一般是开启子进程来执行一些shell脚本,子进程默认情况又是继承自父进程的(除非指定execPath);

所以能想到的办法就是在调度器中起一个父进程,并让其使用正确 node 版本,再通过它去调度插件;

但是由于目前调度器中上下文太多,很难通过 shell 执行某个 js 文件去保持上下文;所以暂缓。

nvm alias default 不是会修改默认 node 版本,新起的 shell 都会继承吗?

是的,在 Terminal 中起多个窗口,这是正常的;但是我们尝试过子进程好像表现并不像是新起 shell,而是衍生 shell,现象是会继承父进程的环境