Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
4.1 KiB

  1. npm-scope(7) -- Scoped packages
  2. ===============================
  3. ## DESCRIPTION
  4. All npm packages have a name. Some package names also have a scope. A scope
  5. follows the usual rules for package names (URL-safe characters, no leading dots
  6. or underscores). When used in package names, scopes are preceded by an `@` symbol
  7. and followed by a slash, e.g.
  8. @somescope/somepackagename
  9. Scopes are a way of grouping related packages together, and also affect a few
  10. things about the way npm treats the package.
  11. Each npm user/organization has their own scope, and only you can add packages
  12. in your scope. This means you don't have to worry about someone taking your
  13. package name ahead of you. Thus it is also a good way to signal official packages
  14. for organizations.
  15. Scoped packages can be published and installed as of `npm@2` and are supported
  16. by the primary npm registry. Unscoped packages can depend on scoped packages and
  17. vice versa. The npm client is backwards-compatible with unscoped registries,
  18. so it can be used to work with scoped and unscoped registries at the same time.
  19. ## Installing scoped packages
  20. Scoped packages are installed to a sub-folder of the regular installation
  21. folder, e.g. if your other packages are installed in `node_modules/packagename`,
  22. scoped modules will be installed in `node_modules/@myorg/packagename`. The scope
  23. folder (`@myorg`) is simply the name of the scope preceded by an `@` symbol, and can
  24. contain any number of scoped packages.
  25. A scoped package is installed by referencing it by name, preceded by an
  26. `@` symbol, in `npm install`:
  27. npm install @myorg/mypackage
  28. Or in `package.json`:
  29. "dependencies": {
  30. "@myorg/mypackage": "^1.3.0"
  31. }
  32. Note that if the `@` symbol is omitted, in either case, npm will instead attempt to
  33. install from GitHub; see `npm-install(1)`.
  34. ## Requiring scoped packages
  35. Because scoped packages are installed into a scope folder, you have to
  36. include the name of the scope when requiring them in your code, e.g.
  37. require('@myorg/mypackage')
  38. There is nothing special about the way Node treats scope folders. This
  39. simply requires the `mypackage` module in the folder named `@myorg`.
  40. ## Publishing scoped packages
  41. Scoped packages can be published from the CLI as of `npm@2` and can be
  42. published to any registry that supports them, including the primary npm
  43. registry.
  44. (As of 2015-04-19, and with npm 2.0 or better, the primary npm registry
  45. **does** support scoped packages.)
  46. If you wish, you may associate a scope with a registry; see below.
  47. ### Publishing public scoped packages to the primary npm registry
  48. To publish a public scoped package, you must specify `--access public` with
  49. the initial publication. This will publish the package and set access
  50. to `public` as if you had run `npm access public` after publishing.
  51. ### Publishing private scoped packages to the npm registry
  52. To publish a private scoped package to the npm registry, you must have
  53. an [npm Private Modules](https://docs.npmjs.com/private-modules/intro)
  54. account.
  55. You can then publish the module with `npm publish` or `npm publish
  56. --access restricted`, and it will be present in the npm registry, with
  57. restricted access. You can then change the access permissions, if
  58. desired, with `npm access` or on the npmjs.com website.
  59. ## Associating a scope with a registry
  60. Scopes can be associated with a separate registry. This allows you to
  61. seamlessly use a mix of packages from the primary npm registry and one or more
  62. private registries, such as npm Enterprise.
  63. You can associate a scope with a registry at login, e.g.
  64. npm login --registry=http://reg.example.com --scope=@myco
  65. Scopes have a many-to-one relationship with registries: one registry can
  66. host multiple scopes, but a scope only ever points to one registry.
  67. You can also associate a scope with a registry using `npm config`:
  68. npm config set @myco:registry http://reg.example.com
  69. Once a scope is associated with a registry, any `npm install` for a package
  70. with that scope will request packages from that registry instead. Any
  71. `npm publish` for a package name that contains the scope will be published to
  72. that registry instead.
  73. ## SEE ALSO
  74. * npm-install(1)
  75. * npm-publish(1)
  76. * npm-access(1)
  77. * npm-registry(7)