JavaScript library
A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. Libraries
With the expanded demands for JavaScript, an easier means for programmers to develop such dynamic interfaces was needed. Thus, JavaScript libraries and JavaScript widget libraries were developed, allowing for developers to concentrate more upon more distinctive applications of Ajax. This has led to other companies and groups, such as Microsoft and Yahoo! developing their own JavaScript-based user interface libraries, which find their way into the web applications developed by these companies. Some JavaScript libraries allow for easier integration of JavaScript with other web development technologies, such as CSS, PHP, Ruby, and Java. While others provide utilities, often in the form of JavaScript functions, to make repetitive and complex tasks less taxing. Many libraries include code to detect differences between runtime environments and remove the need for applications to allow for such inconsistencies. Almost all JavaScript libraries are released under either a permissive or copyleft license to ensure license-free distribution, usage, and modification. Frameworks
Some JavaScript libraries, such as Angular, are classified as frameworks since they exhibit full-stack capabilities and properties not found in general JavaScript libraries. Packages 
All npm packages are JavaScript libraries, but not all libraries are packages. Npm originally stood for "Node Package Manager", as the name implies, npm serves as a package manager for packages used in Node.js runtimes. However, some npm packages offer CDN support for use of the library in both Node.js runtimes as well as the browser. See also
 Ajax framework
 Widget toolkit
 List of JavaScript libraries
 Comparison of JavaScript frameworks

References 

JavaScript