14 Matching Annotations
- Jan 2021
-
www.npmjs.com www.npmjs.com
-
Think first: why do you want to use it in the browser? Remember, servers must never trust browsers. You can't sanitize HTML for saving on the server anywhere else but on the server.
-
- Dec 2020
-
sapper.svelte.dev sapper.svelte.dev
-
Note that preload will run both on the server side and on the client side. It may therefore not reference any APIs only present in the browser.
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
If you want a reference to the global object that works in any context, you can read this from a directly-called function. const global = (function() {return this})();. This evaluates to window in the browser, self in a service worker and global in nodejs.
-
emphasizing that 'this' and 'global object' are two different things not only in Node.js but in JavaScript in general
-
- Oct 2020
-
www.basefactor.com www.basefactor.com
-
Ubiquity: you can also run your validation on the server side (e.g. nodejs)
-
-
github.com github.com
-
Use a node-style require() to organize your browser code and load modules installed by npm.
-
-
github.com github.com
-
browserify is a tool for compiling node-flavored commonjs modules for the browser.
-
-
-
Think of JavaScript. In the browser you don't have direct access to the file system. In Node.js you have. Same programming language. Different APIs.
-
-
stackoverflow.com stackoverflow.com
-
Node.js code must be run by the node process, not the browser (the code must run in the server).
-
- Sep 2020
-
medium.com medium.com
-
Modules using code that doesn’t exist in browsers such as process.env.NODE_ENV and forcing you to convert or polyfill it.
-
-
rollupjs.org rollupjs.orgRollup1
-
Some modules, like events or util, are built in to Node.js. If you want to include those (for example, so that your bundle runs in the browser), you may need to include rollup-plugin-node-polyfills.
-
-
exploringjs.com exploringjs.com
-
Ways of delivering JavaScript source code
-
- Dec 2019
-
github.com github.com
-
One thing that matters is if code uses browser-specific (example: Dom) or server-specific (example: filesystem) features.
-
-
github.com github.com
-
This is a non-dom based javascript execution environment. It usually only contains the base javascript language spec libraries and objects along with modules to communicate with OS features (available through commonjs require).
-