sindresorhus/np

All private scoped packages detected as non-published #314

voxpelli posted onGitHub

This is a slight follow up to #313 and #307 + like those two a follow up to the feature introduced in #258.

We recommend np as the go to tool for publishing modules internally at @sydsvenskan, but since the latest version it always claims that our private scoped modules hasn't been published and asks if they should be published publicly (with a dangerous default as fixed in #313).

The reason is that npm-name only detects public packages as npm, correctly, doesn't expose any data about private packages.

To make the feature introduced in #258 work as a default it should really be required that the lookup also works for private scoped modules.

Alternative solutions to the preferred one above would be:

  • Leave this new feature behind a flag, intended for those who mainly publishes publicly
  • Introduce a flag to disable this feature for those of us who mainly published privately (though this would still nag all of my colleagues about our modules not being published until I got them to use that new flag, which isn't that optimal 😕)

What do you think @ru-lai and @sindresorhus? How would this best be solved?

Code example showing that npm-name doesn't work with private scoped modules:

const npmName = require("npm-name");

(async () => {
    console.log(await npmName('chalk'));                           // Exists, returns false
    console.log(await npmName('hallonkola'));                      // Does not exist, returns true
    console.log(await npmName('@hdsydsvenskan/graphql-partials')); // Exists, returns false
    console.log(await npmName('@hdsydsvenskan/config-loader'));    // Exists privately, but returns true
})();

Runnable here: https://runkit.com/embed/6x5oqgbc5kdv


Fund this Issue

$80.00
Rewarded

Rewarded pull request

Recent activities

yaodingyd was rewarded by sindresorhus for sindresorhus/np# 314
about 6 years ago
yaodingyd submitted an output to  sindresorhus/ np# 314
about 6 years ago