Skip to content

Commit 5d5a3db

Browse files
committed
docs: update installation instructions
1 parent ab892d9 commit 5d5a3db

File tree

2 files changed

+39
-31
lines changed

2 files changed

+39
-31
lines changed

README.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,16 @@ This site is dynamically generated from the contents of the `@latest` distributi
2525

2626
## Installation
2727

28-
### Pre-requisites
28+
The ADM is available on both the npm registry and the GitHub package registry.
2929

30-
To use the ATT&CK Data Model in your TypeScript project, you must first do two setup steps.
31-
32-
1. Create a GitHub Personal Access Token with the `read:packages` scope. Full details can be found in this [GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages). The critical detail from that page is the following:
33-
34-
> To authenticate by adding your personal access token (classic) to your ~/.npmrc file, edit the ~/.npmrc file for your project to include the following line, replacing TOKEN with your personal access token. Create a new ~/.npmrc file if one doesn't exist.
35-
>
36-
> ```//npm.pkg.github.com/:_authToken=TOKEN```
37-
38-
2. Second, set up a scoped registry for GitHub packages:
39-
40-
```bash
41-
npm config set @mitre-attack:registry https://npm.pkg.github.com
42-
```
43-
44-
If you encounter issues, you might need to explicitly add the npmjs.org registry for non-scoped packages:
45-
46-
```bash
47-
npm config set registry https://registry.npmjs.org/
48-
```
49-
50-
To verify your current configuration:
51-
52-
```bash
53-
npm config list
54-
```
55-
56-
### Install
57-
58-
Now you can install the package:
30+
To install from the npm registry, simply run:
5931

6032
```bash
6133
npm install @mitre-attack/attack-data-model
6234
```
6335

36+
See [USAGE.md](./docs/USAGE.md#installing-from-github-package-registry) for instructions on how to install from the GitHub package registry.
37+
6438
## ATT&CK Specification
6539

6640
The ADM is built upon the MITRE ATT&CK® Specification, which formally defines the structure, properties, and relationships of ATT&CK objects. The ATT&CK Specification serves as the authoritative source for how ATT&CK data should be represented and interacted with.

docs/USAGE.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,41 @@ The ATT&CK Data Model (ADM) TypeScript API provides a structured and type-safe w
1313

1414
## Installation
1515

16-
For installation instructions, please refer to the [Installation](../README.md#installation) section in the `README.md` file.
16+
For installation from the npm registry, please refer to the [Installation](../README.md#installation) section in the `README.md` file.
17+
18+
### Installing from GitHub Package Registry
19+
20+
Installing from the npm registry is the preferred solution. But if you must install the ATT&CK Data Model from GitHub's npm package registry, you can do so as follows:
21+
22+
1. Create a GitHub Personal Access Token with the `read:packages` scope. Full details can be found in this [GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages). The critical detail from that page is the following:
23+
24+
> To authenticate by adding your personal access token (classic) to your ~/.npmrc file, edit the ~/.npmrc file for your project to include the following line, replacing TOKEN with your personal access token. Create a new ~/.npmrc file if one doesn't exist.
25+
>
26+
> ```//npm.pkg.github.com/:_authToken=TOKEN```
27+
28+
2. Second, set up a scoped registry for GitHub packages:
29+
30+
```bash
31+
npm config set @mitre-attack:registry https://npm.pkg.github.com
32+
```
33+
34+
If you encounter issues, you might need to explicitly add the npmjs.org registry for non-scoped packages:
35+
36+
```bash
37+
npm config set registry https://registry.npmjs.org/
38+
```
39+
40+
To verify your current configuration:
41+
42+
```bash
43+
npm config list
44+
```
45+
46+
3. Now you can install the package:
47+
48+
```bash
49+
npm install @mitre-attack/attack-data-model
50+
```
1751

1852
## Package Structure
1953

0 commit comments

Comments
 (0)