diff options
author | Max Stoiber <contact@mxstbr.com> | 2018-03-09 00:15:13 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2018-03-09 01:20:45 +0300 |
commit | b2a1cf0844ceaeb51ed04f3ae81678527ec9ae68 (patch) | |
tree | 0a6f720da04a00bb2d98c20c799399c3da5f241b /doc | |
parent | 9847c82a8528cfdf5968e9bb00abd8ed47903b5c (diff) |
docs: document `browser` field (#18382)
Based on https://github.com/defunctzombie/package-browser-field-spec and https://twitter.com/seldo/status/903997474645434368 this adds a very short note about the `browser` field to the package.json docs.
PR-URL: https://github.com/npm/npm/pull/18382
Credit: @mxstbr
Reviewed-By: @zkat
Diffstat (limited to 'doc')
-rw-r--r-- | doc/files/package.json.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/files/package.json.md b/doc/files/package.json.md index a472d065d..e15df11c0 100644 --- a/doc/files/package.json.md +++ b/doc/files/package.json.md @@ -232,6 +232,12 @@ This should be a module ID relative to the root of your package folder. For most modules, it makes the most sense to have a main script and often not much else. +## browser + +If your module is meant to be used client-side the browser field should be +used instead of the main field. This is helpful to hint users that it might +rely on primitives that aren't available in Node.js modules. (e.g. `window`) + ## bin A lot of packages have one or more executable files that they'd like to |