转发附加选项

中英双语

任何附加选项都将直接传递给命令,因此 npm init foo -- --hello 将映射到 npm exec -- create-foo --hello

为了更好地说明选项是如何转发的,这里有一个更进化的示例,显示了传递给 npm cli 和 create 包的选项,以下两个命令是等效的:

  • npm init foo -y --registry=<url> -- --hello -a
  • npm exec -y --registry=<url> -- create-foo --hello -a