javascript - JS - import '@foo/bar' 中@的含义

标签 javascript node.js es6-module-loader

阅读本文时 article早些时候,我遇到了以下代码行:

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

这让我想到了以下问题:

  • 如果有的话,@ 符号的意义是什么?
  • import 'foo/bar'import '@foo/bar' 有区别吗?

它是解决特定类型模块的方法吗?

我对 ES6 比较陌生,虽然 import 语法对我来说似乎非常简单 - 除了在这种情况下,@ 符号的神秘存在。

我尝试使用谷歌搜索,但找不到有关 Stack Overflow 的任何信息,MDN或其他地方。

最佳答案

来自 Getting Started文档:

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.

关于javascript - JS - import '@foo/bar' 中@的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33628522/

相关文章:

javascript - Redux - 如何在其提交处理程序中获取表单值并调用 event.preventDefault()?

javascript - 根据其中字符的长度设置ace编辑器实例的宽度

javascript - 套接字 : Get Client sessionID at any point

javascript - es6 模块原生支持

javascript - MMM dd yyyy 验证正则表达式?

javascript - MongoDB Node.js 脚本实现

javascript - 解析流而不进行裁剪

typescript - 以 ES6 为目标时 Typescript 中的外部模块

node.js - Webstorm 意外 token 导出

javascript - 了解自定义 JQuery 事件以及如何对其进行稍微修改