Skip to content

Commit 56a9a85

Browse files
Address CLI API docs review feedback
1 parent 5492651 commit 56a9a85

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

docs/docs/user-guide/use-cli-api.mdx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,9 @@ sidebar_position: 16
77

88
Typically, you'll work with CLI for Microsoft 365 in a command line. You'll either call specific commands or build automation scripts to combine multiple tasks. But if you're building software, you might want to use CLI for Microsoft 365 from your code.
99

10-
## Configure your Node.js app
11-
12-
CLI for Microsoft 365 is published as an ES module. To use the API in a Node.js app, configure your project to use ES modules.
13-
14-
```json title="package.json"
15-
{
16-
"type": "module",
17-
"dependencies": {
18-
"@pnp/cli-microsoft365": "latest"
19-
}
20-
}
21-
```
22-
23-
Install the dependency by executing:
24-
25-
```sh
26-
npm install @pnp/cli-microsoft365
27-
```
28-
29-
You can then import the API from a `.js` file and run the app with Node.js:
30-
31-
```sh
32-
node index.js
33-
```
34-
3510
## Integrate CLI for Microsoft 365 in your app
3611

37-
If you build apps in Node.js, you can integrate CLI for Microsoft 365 using its API. This API lets you call any of the CLI's commands. The following examples show how you could call several CLI for Microsoft 365 commands in a Node.js app:
12+
If you build apps in Node.js, you can integrate CLI for Microsoft 365 using its API. CLI for Microsoft 365 is published as an ES module, so an app that imports it should use ES modules as well. To add the package to your app, execute `npm install @pnp/cli-microsoft365`. This API lets you call any of the CLI's commands. The following examples show how you could call several CLI for Microsoft 365 commands in a Node.js app:
3813

3914
```javascript
4015
import { executeCommand } from '@pnp/cli-microsoft365';

0 commit comments

Comments
 (0)