Created an npm package to interact with themoviedb API

Created an npm package to interact with themoviedb API

I created my first npm package within 2 days and published it to npm js

Creating the package

I always wanted to create a library/package which could be used by others. but I was not aware how to create a package a publish it to npm js so like any other person I searched for it on youtube and came around various videos, in which people were explaining how to build the package and publish it.

I really liked this video from James Q Quick, In this video he has explained step by step process of creating and publishing a simple package to npm js.

The process of creating and publishing a package is quite simple if you know the basics of javascript/Typescript.

Many packages are now using typescript as it makes the code very easy to understand for other users.

My Package

movietmdb npm link

GitHub Link

After learning about how to build and publish an npm package, It was time for me to execute it. I started thinking about what I can build and came to the idea of creating a package for interacting with the API of themoviedb.org.

themoviedb.org.provides API to get the list of movies and tv shows

What I have used

  • Javascript- For Writing the code cuz I don't have a grasp of typescript.
  • Jsdoc for documentation.
  • node-fetch package for making the API calls.

Why This?

In Past, I had worked on various projects in which I was using the tmdb API for building the project. While creating the projects I was repeating similar codes for different types of data with a minor variation. This was making my code quite lengthy, so I thought why not make a package for handling this stuff.

you can view my code on GitHub to see the setup of the package and to view the source code. :)

What I learned?

  • The process of creating and publishing an npm package is quite simple.
  • Typescript would be very helpful in creating an npm package.
  • Documenting my code for others to understand it.
  • OOP is really important while creating an npm package.