0
Where to get online libraries for codes
Hey a question for coders, I saw many programs using online libraries for many different functions . So i have a question that how do I know that the library i need is present at which website. Do I have to google each time I need them or see each of them one by one at the site, and also do I need to download the libraries mentioned in a code if i am to use it offline😓
4 Antworten
+ 6
Regarding the part "how do I know that the library i need is present at which website."
Yes, google is probably the right answer here.
Sometimes you'll also find yourself looking stuff up without knowing if a library that does what you want even exists.
Sometimes it won't exists and you might find yourself trying to implement it yourself.
You might even publish it as a package then for others to use.
The circle of package life....
+ 3
......
B) you want to use a library as a dependency in your project
For that you have package managers such as npm, yarn, bower and more
Dependencies are installed in a specific folder in your project root (node_modules, bower_components, ...) and afterwards can be imported and used from anywhere in your project.
Each module that you add to the project will be also added to a file called package.json as a key: value of the package name, and its version
This file contains all the required data for installation of the dependencies and some other information...
This is just the tip of the iceberg
I suggest you look inside the following links to learn more about cdn and package managers
https://www.sitepoint.com/what-is-a-cdn-and-how-does-it-work/
https://www.w3schools.com/whatis/whatis_npm.asp
https://www.keycdn.com/blog/npm-vs-yarn
+ 2
You have few options here depending on your use case:
A) you want to use a library here on SoloLearn code playground
You can search google for the library name with the additional keyword "cdn" => for example if you want to incorporate jQuery in your code, the search "jquery cdn"
The first result would direct you to https://code.jquery.com
In there you can find different versions of the library and the code you need to add in your code (the <script> tag)
After adding the tag (and depending on how well the library is written) you should have the library exposed in your code (for jquery you should be able to use its iconic $ sign)
Some libraries will have a short installation description in the library homepage/github repo, but not always, so digging into the library code is sometimes required (and a good practice ;) )
continued in next comment....
+ 1
Thanks for the help Burey sir...