Umdify node modules
<!DOCTYPE html>
<html>
<head>
<title>My app</title>
</head>
<body>
<script type="module">
import objectAssign from 'https://unpkg.com/@umds/object-assign';
console.log(objectAssign({one: 1}, {two: 2}));
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>My app</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.js"></script>
<script type="text/javascript" src="https://unpkg.com/@umds/object-assign"></script>
<script>
requirejs(['object-assign'], (objectAssign) => {
console.log(objectAssign({one: 1}, {two: 2}));
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>My app</title>
</head>
<body>
<script type="text/javascript" src="https://unpkg.com/@umds/object-assign"></script>
<script>
console.log(window['object-assign']({one: 1}, {two: 2}));
</script>
</body>
</html>
You can umdify any modules by editing: umds.json
MIT © Thomas Sileghem