---
name: "npm-set-script"
section: "1"
platform: "linux"
package: "npm"
version: "7.5.2+ds-2"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/npm-set-script"
---

# npm-set-script(1)

Set tasks in the scripts section of package.json

## NAME

**npm-set-script** - Set tasks in the scripts section of package.json

### Synopsis

An npm command that lets you create a task in the scripts section of the package.json.

```
npm set-script [<script>] [<command>]
```

**Example:**

- •

  **npm set-script start "http-server ."**

```
{
  "name": "my-project",
  "scripts": {
    "start": "http-server .",
    "test": "some existing value"
  }
}
```

### See Also

- •

  npm help run-script

- •

  npm help install

- •

  npm help test

- •

  npm help start
