Why does this library has npm package?
See original GitHub issueHi,
I used this package in the browser and it works great.
When I realized that it is also available as npm package. I was wondering why and how we can use it on the server side.
I also saw this code in github project page:
// CommonJS:
const dat = require('dat.gui');
// ES6:
import * as dat from 'dat.gui';
If I am not wrong the above both are serverside JS programming similar to NodeJS, can’t be used in the browser unless we build them with browserify or rollup.
My question is why is this package available in npm? Is there any use cases of using it in server side?
With regards, Nithin B.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
libraries - npm
Why? This project was created in response to ember-cli #2177. It aims to make it easier and more flexible to configure libraries to...
Read more >How to Create an npm Package Ready to Distribute - Bugfender
When you create an npm library you will create a json file called package.json in which you specify which dependencies your JS library...
Read more >Publish Your First Node Library Using NPM - Live Code Stream
If you are a Node.js developer, using npm packages won't be a new concept to you. From complex npm packages like express to...
Read more >NPM is installing lots of libraries - node.js - Stack Overflow
npm prior to version 3.x installs libraries in a tree structure, so each library has its own node_modules and so on.
Read more >Using the npm library - Vev Help Center
npm is the package manager for Node.js, a back-end JavaScript runtime environment. The npm Registry is a public collection of packages of open-source...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not really sure what you’re confused by, as you seem to have answered your own question. You wouldn’t use this on the server side, it’s just an example of how to load the library in ES6 and/or extend it’s functionality, which can then be compiled to run in a browser, hence you can install it with npm.
This library doesn’t officially run serverside in Node.js. With some (a lot) of work you could perhaps hotpatch it to function, but I wouldn’t be able to tell you how to do so sorry. And just generating HTML is not enough… you still need JS to make the GUI interactive, and so the
dat.gui
package needs to be in the client anyway.So, the npm package exists purely for users who want to use dependency management to build their browser-side packages as @MacroMan mentions.