4

While reading this article earlier, I came across the following line of code:

import { run } from '@cycle/core';

Which led me to the following questions:

  • What is the significance of the @ symbol, if any?
  • Is there a difference between import 'foo/bar' and import '@foo/bar'?

Is it a way to resolve a particular type of module?

I'm relatively new to ES6, although the import syntax seems pretty straightforward to me - except, in this case, for the cryptic presence of the @ symbol.

I tried googling but couldn't find any information on Stack Overflow, MDN or elsewhere.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Darragh Enright
  • 13,676
  • 7
  • 41
  • 48

1 Answers1

4

Right from the Getting Started docs:

Packages of the type @org/package are npm scoped packages, supported if your npm installation is version 2.11 or higher. Check your npm version with npm --version and upgrade in order to install Cycle.js.

In case you are not dealing with a DOM-interfacing web application, you can omit @cycle/dom when installing.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • Boom. That was incredibly fast. Thanks @Álvaro! Yeah, I never really thought to look into the cycle.js docs themselves - and clearly my google-fu is lacking. For anyone else curious there is some information on scoped packages on the [NPM blog](http://blog.npmjs.org/post/116936804365/solving-npms-hard-problem-naming-packages) and a more in-depth discussion [here](http://blog.nodejitsu.com/a-summary-of-scoped-modules-in-npm/). – Darragh Enright Nov 10 '15 at 11:17