> For the complete documentation index, see [llms.txt](https://docs.mosaic.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mosaic.js.org/develop-an-extension/anatomy-of-an-extension.md).

# Anatomy of an extension

## Package.json

For NPM package to be considered an [extension](broken://pages/-MZIMMdiBcQjgReqHOyM#what), it must have a `package.json` field `mosaic.type` equal to `extension`.

It is important for Mosaic module to be recognized in order for [namespaces](/develop-an-extension/namespaces.md) to work properly (get transpiled into logic).

```javascript
{
    "mosaic": {
        "type": "extension"
    }
    ...
}
```

## File structure

Mosaic has a minimal requirement towards the folder structure of a module.&#x20;

All of the `.plugin.js` files ([plugin declaration files](/develop-an-extension/anatomy-of-an-extension.md#plugin-declaration-files)) should be located under the `src/plugin` directory. All the subdirectories of this one are scanned for them, but no other places.

It's recommended to split all of your other logic into separate directories of the `src` directory. All of the functionality outside of `src` will not be available for [shadowing](/themes/parent-themes.md).

```bash
├── 📁  node_modules
├── 📄  package.json
└── 📁  src
   ├── ...        # Any own logic of your extension here
   └── 📁  plugin # Plugging logic here!
       ├── 📄  some.plugin.js
       └── 📄  other.plugin.ts
```
