Search code examples
javascriptnpmpackageinstallationsapui5

Installing NPM Package from Github for SAPUI5 WebIde


I want to install an NPM package from Github so that it can be used in SAPUI5, WebIde Framework.

Package: https://github.com/commenthol/date-holidays/blob/master/README.md#usage

First Problem In order to import a Library there should be a File with the Library so it can be copy-pasted in WebIde in the backend.

Second Problem The Usage - Part: should this piece of Text be part of the Frontend?

Third Problem: Copyright https://github.com/commenthol/date-holidays/blob/master/LICENSE: Author states that it can be used, unless the copyright notice and permission notice appear in all copies. Now if you inspect a Page created by SAPUI5 /NodeJS, you will never ever see any commentaries that were done in the WEBIDE, is it necessary to state it in the Code as a commentary if nobody will see it?

Fourth Thing on the side: For Example: npm install express, will Install data into package.json, how do i make it install for example express Pack into example.json instead of package.json?


Solution

  • Here you go, the package is available on npm as date-holidays
    you can do npm i date-holidays
    If you want to install package from github you install it by
    npm i git+https://github.com/commenthol/date-holidays
    After that
    var Holidays = require(date-holidays); var hd = new Holidays(); hd.getStates('US');
    and so on, you can use the library as may like.