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

cfnpm

v1.0.2

Published

npm for cloud foundry, allow deployment of private local package to cloud foundry / bluemix / stackato

Downloads

6

Readme

cfnpm

npm for cloud foundry, allow deployment of private local package to cloud foundry / bluemix / stackato

Description

Imagine you have several applications that want to share the same common package but you don't want to publish your private package to npm for privacy reason.

This is something you can manage easly today with npm since it allow referencing local package dependency. But this is not compatible with the Cloud Foundry deployment model, you have no way to deploy a 'package' that other applications depends on. Cloud foundry expect your private package to be packaged with your application.

cfmpm aims to solve this probleme by providing an automated way to package, with your application, all private local packages before beeing pushed to cloud foundry PaaS. In addition, cfnpm take care of the development environment by automaticaly managed a 'npm link' to all your private local packages, so you cann continue the develoment of your private local package and application transparently.

How it works ?

cfnpm is a package that must be executed as a postintall script of npm, so you must update the package.json of your current application as follow:

{
 ...
 "scripts": {
         "postinstall":"node -e \"require('cfnpm')\""
    },
 ...
}

So, each time you execute npm install, cfnpm will be executed post dependency resolution.

Now, to define your private local package, you must add a new field privateDependencies in your 'package.json' , this field must contain the list of private package and their location (same format package.json dependencies syntax):

    "scripts": {
         "postinstall":"node -e \"require('cfnpm')\""
    },
    "dependencies": {
        "mongodb": "2.0.34"
    },
    "privateDependencies":{
	  "mymodule":"../mymodule"
    }

Now if you run npm install, you will see two things:

  • your node_modules will contains link to your local package
  • A new folder private_node_modules has been created and contains a copy of your local private package, this is for your futur deployment to cloud foundry

Now, once you push to cloud foundry, npm install is executed during the staging and cfnpm detect it is cloud foundry staging. it will then manage to :

  • run npm install on all your private local package located in private_node_modules
  • copy back all your private local package from private_node_modules to your node_modules

If you look at the test folder of cfnpm, there is dummy example of cfnpm usage, it contains two folders:

  • /amodule that is the private local folder that aims to be shared by several application
  • /app is one app that 'use' amodule