问题
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'
andimport '@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.
回答1:
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.
来源:https://stackoverflow.com/questions/33628522/js-meaning-of-in-import-foo-bar