# NPM script trigger

If you want to run any script after or before the component creation, you can use our custom commands.

* `post-component-creation`: This command will be executed after the component creation.
* `pre-component-creation`: This command will be executed before the component creation.

To use this feature, you need to add the following code to your `package.json` file.

```json
{
  "scripts": {
    "post-component-creation": "echo 'Component Created'",
    "pre-component-creation": "echo 'Component Creation Started'"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.haydejs.com/docs/npm-scripts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
