Skip to content

Commit 390dbdb

Browse files
committed
Add missing document metadata (#1239)
Fixes: #1238
1 parent 46ae677 commit 390dbdb

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed
Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,57 @@
1-
## To publish N-API version of a package alongside a non-N-API version
1+
---
2+
title: How to publish N-API package
3+
layout: docs.hbs
4+
---
5+
6+
# To publish N-API version of a package alongside a non-N-API version
27

38
The following steps are illustrated using the package `iotivity-node`:
49
- First, publish the non-N-API version:
5-
- Update the version in `package.json`. For `iotivity-node`, the version
10+
- Update the version in `package.json`. For `iotivity-node`, the version
611
becomes `1.2.0-2`.
712
- Go through the release checklist (ensure tests/demos/docs are OK)
813
- `npm publish`
914
- Then, publish the N-API version:
10-
- Update the version in `package.json`. In the case of `iotivity-node`,
11-
the version becomes `1.2.0-3`. For versioning, we recommend following
12-
the pre-release version scheme as described by
15+
- Update the version in `package.json`. In the case of `iotivity-node`,
16+
the version becomes `1.2.0-3`. For versioning, we recommend following
17+
the pre-release version scheme as described by
1318
[semver.org](http://semver.org/#spec-item-9) e.g. `1.2.0-napi`.
1419
- Go through the release checklist (ensure tests/demos/docs are OK)
1520
- `npm publish --tag n-api`
1621

17-
In this example, tagging the release with `n-api` has ensured that, although
18-
version 1.2.0-3 is later than the non-N-API published version (1.2.0-2), it
19-
will not be installed if someone chooses to install `iotivity-node` by simply
20-
running `npm install iotivity-node`. This will install the non-N-API version
21-
by default. The user will have to run `npm install iotivity-node@n-api` to
22-
receive the N-API version. For more information on using tags with npm check
22+
In this example, tagging the release with `n-api` has ensured that, although
23+
version 1.2.0-3 is later than the non-N-API published version (1.2.0-2), it
24+
will not be installed if someone chooses to install `iotivity-node` by simply
25+
running `npm install iotivity-node`. This will install the non-N-API version
26+
by default. The user will have to run `npm install iotivity-node@n-api` to
27+
receive the N-API version. For more information on using tags with npm check
2328
out ["Using dist-tags"][].
2429

25-
## To introduce a dependency on an N-API version of a package
30+
# To introduce a dependency on an N-API version of a package
2631

27-
To add the N-API version of `iotivity-node` as a dependency, the `package.json`
32+
To add the N-API version of `iotivity-node` as a dependency, the `package.json`
2833
will look like this:
2934

30-
```JSON
31-
"dependencies": {
32-
"iotivity-node": "n-api"
33-
}
35+
```json
36+
"dependencies": {
37+
"iotivity-node": "n-api"
38+
}
3439
```
3540

36-
**Note:** As explained in
37-
["Using dist-tags"][], unlike regular versions, tagged versions cannot be
38-
addressed by version ranges such as `"^2.0.0"` inside `package.json`. The
39-
reason for this is that the tag refers to exactly one version. So, if the
40-
package maintainer chooses to tag a later version of the package using the
41-
same tag, `npm update` will receive the later version. This should be acceptable
42-
given the currently experimental nature of N-API. To depend on an N-API-enabled
43-
version other than the latest published, the `package.json` dependency will
41+
**Note:** As explained in
42+
["Using dist-tags"][], unlike regular versions, tagged versions cannot be
43+
addressed by version ranges such as `"^2.0.0"` inside `package.json`. The
44+
reason for this is that the tag refers to exactly one version. So, if the
45+
package maintainer chooses to tag a later version of the package using the
46+
same tag, `npm update` will receive the later version. This should be acceptable
47+
given the currently experimental nature of N-API. To depend on an N-API-enabled
48+
version other than the latest published, the `package.json` dependency will
4449
have to refer to the exact version like the following:
4550

46-
```JSON
47-
"dependencies": {
48-
"iotivity-node": "1.2.0-3"
49-
}
51+
```json
52+
"dependencies": {
53+
"iotivity-node": "1.2.0-3"
54+
}
5055
```
5156

52-
5357
["Using dist-tags"]: https://docs.npmjs.com/getting-started/using-tags

0 commit comments

Comments
 (0)