How to index an NPM library?

I have a specific NPM library that I need indexed. It does not have a website or good docs.

What is the best way for me to ensure this NPM lib is included as context, so that Cursor knows how to use its methods?

You need some kind of overview for how the library works so that Cursor can interact with it.

If it’s a big and confusing library, one method you might try is to dump a large amount of it into Claude and then ask it to summarise the key features, methods, and usage patterns. Save this as a .md file, then @ it in your chats with Cursor.

Appreciate the response. A manual hack, but I may need to do that.

I would love to see this ability to index a dependency in the same way that I can index docs. This seems really important

You may be able to use Cursor to shortcut this even without a bespoke method within the editor itself.

One method would be to open Cursor directly to the library source code on your own machine and get it to generate some documents about itself which you could then feed into your own project.

Alternatively, you might want to use the @web shortcut, which may let Cursor look the project up itself and learn enough to use it without any direct instructions.