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

try-ramda

v1.1.0

Published

https://www.npmjs.com/package/try-ramda

Downloads

1

Readme

https://www.npmjs.com/package/try-ramda

npm publish -f not allowed anymore

https://github.com/npm/npm-registry-couchapp/issues/148#issue-27410798

"With this change, if you publish [email protected], you can still un-publish [email protected]. But then, you will not be able to publish something else to that same package identifier. Not now, not never. Deleting documents entirely will be forbidden (though of course old revs still get compacted out) and we'll have a lot more visibility into what each change in the db does.

I wouldn't characterize it as a security fix, per se, but it does reduce a significant gotcha that users have run into over the years, which is especially annoying when deploying Node servers to production. If the bits are gone, ok, it's an error, you notice and deal with it. But if the bits are changed, then this can be really hazardous."

peer dependencies

https://github.com/npm/npm/releases/tag/v3.0.0 starting from npm 3, peerDependencies are not automaticlaly installed by npm install, but instead, npm generated warnings. Here is more details:

  • #6930 (#6565) peerDependencies no longer cause anything to be implicitly installed. Instead, npm will now warn if a packages peerDependencies are missing, but it's up to the consumer of the module (i.e. you) to ensure the peers get installed / are included in package.json as direct dependencies or devDependencies of your package.
  • #3803 npm also no longer checks peerDependencies until after it has fully resolved the tree.

Here is an example when installing try-ramda, which has declared peerDependencies:{ "ramda": "^0.25.0"}

/media/bochen2014/Work/tmp/try-ramda-consumer$ npm install try-ramda
npm WARN [email protected] requires a peer of ramda@^0.25.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 2 packages in 5.911s

git+https://github.com/bochen2014/try-ramda-commander.git

this won't give you what you want as it simply include the source code to consumer project; npm publish won't be run

# this won't work. this will install source code; not published version of try-ramda
$ yarn add --dev git+https://github.com/bochen2014/try-ramda-commander.git

archive (v1)

how does commander workds

"build": "babel src --out-dir node_modules/try-ramda/lib   --source-maps",
"postbuild":"cd node_modules/.bin && ln -s ../try-ramda/bin/try-ramda try-ramda",
"remove": "rm node_modules/.bin/try-ramda",
"debug": "node --inspect-brk node_modules/try-ramda/bin/try-ramda  start"


/media/bochen2014/Work/__work/try-ramda/node_modules/.bin (master *)$ ls -l
total 7
lrwxrwxrwx 1 bochen2014 bochen2014 58 Nov 30 23:30 babel -> ../babel-cli/bin/babel.js
lrwxrwxrwx 1 bochen2014 bochen2014 60 Dec  1 00:04 try-ramda -> ../try-ramda/bin/try-ramda

source code

    Command.prototype.command = function(name, desc, opts) {
    if(typeof desc === 'object' && desc !== null){
        opts = desc;
        desc = null;
    }
    opts = opts || {};
    var args = name.split(/ +/);
    var cmd = new Command(args.shift());
    //***************************************************************
    debugger;
    if (desc) {
        cmd.description(desc);

        this.executables = true;

        this._execs[cmd._name] = true;
        if (opts.isDefault) this.defaultExecutable = cmd._name;
    }
    //***************************************************************
    cmd._noHelp = !!opts.noHelp;
    this.commands.push(cmd);
    cmd.parseExpectedArgs(args);
    cmd.parent = this;

    if (desc) return this;
    return cmd;
    };



Command.prototype.parse = function(argv) {
  debugger;
  // try-ramda ARG ==> try-ramda-ARG 
  if (this.executables && argv.length < 3 && !this.defaultExecutable) {
    // default to --help (i.e. when no args provided, defualt to --help)
    argv.push('--help');
  }

    // executable sub-commands
  var name = result.args[0];
  if (this._execs[name] && typeof this._execs[name] != "function") {
    return this.executeSubCommand(argv, args, parsed.unknown);
  }
}

Command.prototype.executeSubCommand = function(argv, args, unknown) {
    if (process.platform !== 'win32') {
        if (isExplicitJS) {
        args.unshift(bin);
        // add executable arguments to spawn
        args = (process.execArgv || []).concat(args);

        proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
        } else {
        proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
        }
    } else {
        args.unshift(bin);
        proc = spawn(process.execPath, args, { stdio: 'inherit'});
    }
}