Skip to content

Importing Typescript class from another npm library #2262

Description

@omer727

Hi,
I'm working on node.js with npm. I've written a TS library and I want to use it in another project by doing npm install.
I'm not sure what will should be the contents in my npm package:
should it be only .js, only .ts, or .js with additional declaration files (d.ts)?

Furthermore if I'm using the third option, what exactly am I writing in the definition file? how exactly am I using it?I'm not sure what's the connection between d.ts and the actual javascript.
I see a lot of different answers but most them didn't help me.

Thanks,
Omer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions