# Loader / NPM docs feedback
As a reference documentation, nice! I’d imagine that beginners would like more handholding, so a „guide“ start to finish (for releasing a npm package) would lower the bar
- The doc https://docs.astro.build/en/reference/publish-to-npm/ is linked but it seems to be specific to Astro components. Most things probably apply but some information has to be found between the lines. For example, that one should ship ESM-only isn’t written down but can be derived from the package.json. That could be made more obvious. Generalizing the language would also make it more obvious that you can use this doc for content loaders, too.
- This doc or the „publish to npm“ is missing the important bit that you should also publish TypeScript types with your package
- For the „name“ of the loader, if you have opinions on how the naming scheme should be (like we had with gatsby-source-xyz) write it down
- Mention that you can put multiple loaders into one NPM package, not just one
- We both used environment variables for loading common options. This tip can also go into the docs
- While https://docs.astro.build/en/reference/content-loader-reference/#loader-api shows all available loader APIs it doesn’t prominently give recommendations on what to use/what is required and what not. Establish best practices here, because the examples in the earlier parts of the doc e.g. don’t show the „parseData()“ function while I’d argue that it would be very important to always run it. It’s mentioned in a paragraph of DataEntry but can easily be missed
- No information on how to handle network errors or throw errors
- Highlight more that store.set() id must be unique
## Feedback in conversation
- When I’ve tried writing loaders, I’ve found it difficult and the docs insufficient. You generally need to go read the blog posts about content layer to figure stuff out.
- It might actually be helpful to separate the function/inline loaders and object loaders more. There's such a jump in terms of complexity between them, they are kinda different users
- Here’s an example of docs lacking a bit: [Entries from a custom content l…](https://discord.com/channels/830184174198718474/1318990658287173734)
This person has managed to create a loader but we’re not explaining how to make the loader render like built-in loader entries
- There are lots of occasions when building a bespoke integration just for your site can be handy
- The biggest advice that resonating with me from Lennart’s list was that there isn’t a prescription for making a “proper” loader. Like we don’t say you should use a digest or how to create a digest wisely etc or how to clear the store properly for the dev experience to be smooth etc
- I made an internal loader for shopify products a few days ago and yeah i had to check the source of matt's loaders, docs were not enough