3

I want to use @organization-scope/package/sub-package in npm.

My package.json is as follows:-

{
  "name": "@once/ui",
  ...
  ...
}

If I do it like this:-

{
  "name": "@once/ui/select-box",
  ...
  ...
}

It gives me an error saying invalid name.

I am using angular 5. Can someone help me do achieve the same?

RobC
  • 22,977
  • 20
  • 73
  • 80
Dinesh Rawat
  • 970
  • 10
  • 32

1 Answers1

5

There is no such thing as a nested scope in NPM.

Trying to import @once/ui/select-box would give you a file called select-box.js from within the root of the @once/ui package - you can utilize this behaviour to get something close to what you're trying to achieve, but publishing a package with multiple slashes in the name is not possible.

Joe Clay
  • 33,401
  • 4
  • 85
  • 85