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

npm-xeraglobal

v3.1.0

Published

Tool for one-time installation of modules for each project to %HOMEPATH%/.npm_modules (Windows and Linux only)

Downloads

7

Readme

npm-xeraglobal NPM version

This tool installs modules in the default global directory(%GlobalDirNpm%) and the global home directory(%HOMEPATH%/.node_modules/), which allows you to include them in your project due to the specificity of the require function.

Table of Contents

  1. Installation
  2. Migration
  3. Usage
  4. Troubleshooting
  5. About --delete-trash flag
  6. Local installing modules
  7. Local removing modules
  8. Packages upgrade
  9. Sorting dependencies
  10. Reversing dependencies
  11. Removing dependencies
  12. About --use-this-dir, --no-save and --auto-support flags
  13. Unlinking
  14. Linking
  15. Global delete
  16. Examples
  17. Contacts

Changelog

HERE!

Installation

To update, you should also run this command.

npm install npm-xeraglobal -g

Migration

To migrate from version 2 to version 3 run the following commands:

npmunxer && npm i npm -g && npm install npm-xeraglobal -g

Usage

(sudo)? [npmx|npmxer|npmxeraglobal] [i|install] <...module > [--dt|--ns|--utd|--sd|--as|--asr]

Troubleshooting

sudo gulp task: module gulp not found, as well as sudo webpack and sudo node: module not found:

This error occurs because node.js uses safeGetEnv("HOME") in Module._initPaths. The solution is to use sudo --preserve-env (-E) - sudo -E gulp task, sudo -E webpack, sudo -E node nodefile.

Webpack installation:

npm i webpack-cli --global && npmxer install webpack

Gulp installation:

npmxer install gulp

About --delete-trash flag

npmx install <...module > [-dt|--dt|--delete-trash]

Its main task is to delete directories and files located in the root of the module and do not affect the main functionality, if, of course, they are there. It only checks for %HOME%/.node_modules/ path, and the global folder will contain absolutely all files. README, as well as license, authors, and contributors files, are ignored and will not be deleted. Modules installed via @ are also ignored (for example, npmx i @babel/core).

Will be found and deleted:

  • Following folders:
    • .idea
    • .git
    • .github
    • example
    • examples
    • test
    • tests
  • Following files:
    • .npmignore
    • .npmrc
    • .gitattributes
    • .gitignore
    • .gitmodules
    • .editorconfig
    • .eslintignore
    • .eslintrc
    • .travis.yml
    • .tidelift.yml
    • appveyor.yml
    • make + Make
    • makefile + Makefile
    • rakefile + Rakefile

Local installing modules

The official package manager can create nasty conflicts with already installed globally modules using this module, for example, delete information about them in package.json.

To install modules locally without conflicts, use the following command:

npmx [installLocal|il] <...module>

Example: npmx il someModule. Almost equivalent to this: npm i someModule.

Local removing modules

The official package manager can create nasty conflicts with already installed globally modules using this module, for example, delete information about them in package.json.

To remove local modules without conflicts, use the following command:

npmx [r|rm|rem|remove|uninstall|del|dl|d] <...module>

Example: npmxer r someModule. Almost equivalent to this: npm r someModule.

Packages upgrade

This will update the package.json in the new project without loading the module again.

If the package.json does not exist - it will be created.

npmx [xerup|upxer|up|uppackages] <...packages> [-D|--save-dev]

Example: npmx up gulp webpack -D.

Sorting dependencies

This will sort dependencies and devDependencies by name.

npmx [xerup|upxer|up|uppackages] [s|srt|st|sort]

Example: npmx xerup sort.

Reversing dependencies

This will reverse the contrary dependencies and devDependencies.

npmx [xerup|upxer|up|uppackages] [rv|rvs|rvrs|reverse]

Example: npmx upxer rvrs.

Removing dependencies

npmx [xerup|upxer|up|uppackages] [null|d|r|rm|rmv|remove|delete|dlt|dl|del] <...packages> [-D|--save-dev]

Example: npm uppackages null gulp webpack webpack-stream del

About --use-this-dir, --no-save and --auto-support flags

--use-this-dir:

The --use-this-dir(--utd) flag was added to write dependencies to the directory from which the installation is performed (when installing into a project without --utd, the main project package is located).

npmx [install|i] <...module> [--utd|--use-this-dir]

--no-save:

Does not write dependencies to package.json .

npmx [install|i] <...module> [--ns|--no-save]

--auto-support:

Attempts to write automatic recommended support to dependencies.

npmx [install|i] <...module> [--as|--auto-support|--ass]

--auto-support-real:

The same as --auto-support only changes the original file and not the linked one.

npmx [install|i] <...module> [--asr|--auto-support-real|--real-ass]

Unlinking

This command will remove references to the global module from %HOMEPATH%/.node_modules/ .

npmx [unlink|unl] <...module>

Linking

This command will allow you to re-link global modules to %HOMEPATH%/.node_modules/ .

npmx [link|l|lnk] <...module>

Global delete

This collection of commands will allow you to uninstall what was installed with npmx install:

npm unlink <...module> && npm remove --global <...module>

Examples

First, install the modules.

D:\NodeProjects\yourProject> npmx i gulp
D:\NodeProjects\yourProject> npmx i browser-sync -D

Then create a file "index.js".

"use strict";

const gulp = require("gulp");
const browserSync = require("browser-sync").create();

gulp.task("hello", cb => {
	console.log("Hello");
	cb();
})

gulp.task("serve", () => {

	browserSync.init({
		server: "front"
	});

	browserSync.watch("front/**/*.*").on("change", browserSync.reload);

});

And run it!

D:\NodeProjects\yourProject> gulp hello
D:\NodeProjects\yourProject> gulp serve
[ctrl+c] y

For new projects, gulp and browser-sync (in the context of this example) will be available as local modules.

Now let's create a new project and update its dependencies.

D:\NodeProjects\yourProject> cd .. && mkdir testProject && cd testProject
D:\NodeProjects\testProject> npmx xerup gulp browser-sync -D

Creating index.js:

"use strict";

const gulp = require("gulp")

gulp.task("default", cb => {
	console.log("Hello World!")
	cb()
})

Run it:

D:\NodeProjects\testProject> gulp

Contacts

Yandex Mail - [email protected]

Github - https://github.com/StormExecute/

Platforms

Github - https://github.com/StormExecute/npm-xeraglobal/

NPM - https://www.npmjs.com/package/npm-xeraglobal/

License

MIT - https://mit-license.org/