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

local-dependencies

v1.0.0-beta3

Published

Install and watch local npm dependencies

Downloads

12

Readme

Local Dependencies

Motivation

The npm link command can lead to unexpected behaviors:

  • Dependencies that are present in the root module and the linked module resolve to different instances.
  • Peer dependencies in the linked module are not available.
  • Build tools such as babel fail to find their plugins unless an absolute path is specified.

However, npm link is extremely useful when working on multiple modules at the same time. It allows a developer to have the local updates available immediately. The goal of this module is to provide the convenience of links while avoiding their pitfalls.

Usage

Install the local-dependencies module by running npm install --save-dev local-dependencies. The module defines a few commands that can be used while developing your project, they are:

  • configure-local-dependencies : Launch the cli to generate a .ldrc file in your project. The .ldrc file stores information about all your local dependencies and whether they should be watched.
  • install-local-dependencies : Install the local dependencies into your project. Your project's npm dependencies are also installed.
  • watch-local-dependencies : Install the local dependencies and watch them for changes. When a change is detected in one of the dependency, it is reinstalled into your project.

In order for configure-local-dependencies to work, the dependencies should be part of your project's package.json.

If your local dependency defines a prepublish script, its dependencies are installed and npm run prepublish is executed before copying the content into your root project.

Your project can use the commands defined by the local-dependencies module in its own package.json scripts to be easily used by other developers:

{
 "scripts": {
   "configure-dependencies": "configure-local-dependencies",
   "install-dependencies": "install-local-dependencies",
   "watch-dependencies": "watch-local-dependencies"
 }
}

Once your scripts are defined in your project, the developer should:

  1. Run npm run configure-children to generate the .ldrc file.
  2. Run npm run install-dependencies to install local dependencies into the project.
  3. Optional Run npm run watch-dependencies during development so that updated local dependencies are quickly reinstall.

The scripts should be run from the project's root directory where the .ldrc is located.

Development

The API documentation can be found here

This project defines a few npm scripts that you can use to help you develop on this project:

  • Use npm run compile to compile the src folder using babel. The compiled files are put in the lib folder.
  • Use npm run compile-watch to watch the src for changes and recompile the files.
  • Use npm run docs to generate the project's documentation
  • Use npm run docs-watch to create a documentation server which gets updated continuously
  • Use npm run docs-md to generate the DOCUMENTATION.md file
  • Use npm run lint to make sure your code conforms to this project's standards
  • Use npm run fix-lint to make sure your code conforms to this project's standards and fix simple issues (spacing etc...)

Make sure you install the dev dependencies in order to use the commands above.