A brief history of specifiers and protocols
macwright.com·20h
🔌Interface Evolution
Preview
Report Post

If you’re running JavaScript on a server, how do you import a module? Traditionally, imports looked like this, with CommonJS:

const axios = require('axios');

But now they look like this with ECMAScript Modules:

import axios from 'axios';
// Or, less often, dynamically:
const axios = await import('axios');

However, there’s another layer of complexity: import specifiers.

2021: Node.js introduces the node: protocol

I think the first kind of specifier for a real runtime - and I’ll be specific about that because the Webpack bundler supported a tremendous variety of import styles before this - was Node.js, in …

Similar Posts

Loading similar posts...