DEV Community

Sahithyan
Sahithyan

Posted on

How to develop a JavaScript library for DOM (like jQuery)?

Corona Quarantine really sucks. So I decided to develop a library like jQuery. But I don't know how to start.

Please help me with this.

NOTE Please don't refer to a video. I have Data usage problems.

Top comments (3)

Collapse
 
sergchr profile image
Serhii
  1. Write some useful functions to manipulate DOM, like those you can see in jQuery.
  2. Make an API, so your library can be used like jQuery has the $ function for that.
Collapse
 
iamsahithyan profile image
Sahithyan • Edited

Yeah, I already wrote the basic code. IN ONE FILE.
AND what I am asking is "how should I get started"?

Should I start an npm package? If it is an npm package, How can I make sure that my library will work on a browser?

BTW, My library doesn't have every functionality that jQuery has.

Collapse
 
sergchr profile image
Serhii

If you want other people to use your package, you need to publish it to NPM. To check, if your package works properly in different environments (how to write packages for Node and browsers), you can link the package locally and connect to your existing apps.