0

This questions has probably been asked before but I couldn't find all the answers. If that's the case, sorry.

I'm pretty familiar with how package.json and dependencies / dev-dependencies work for Node apps.

Now I'm studying Angular 2 and the first thing that struck me was: What are those dependencies starting with @angular and @type? How do they work?

I realized they have 2 things I'm not used to:

  1. They start with an @
  2. They are linear in the name (@angular/something), but inside node_modules they are hierarchical.

So, is this an Angular/Typescript specific thing, or it's just something about NPM that I didn't know about?

I mean, if I publich an NPM package called @banana/core, is it going to work and inside my node_modules I'll have a folder called @banana with another one called core inside, or is it specific to Angular or TypeScript?

Andre Pena
  • 56,650
  • 48
  • 196
  • 243

1 Answers1

2

It is not specific to Angular or TypeScript -- it is an NPM feature allowing for grouping of modules:

https://docs.npmjs.com/misc/scope

Matt Altepeter
  • 956
  • 1
  • 8
  • 18