Skip to content

Instantly share code, notes, and snippets.

@edrex
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save edrex/9ad2e2f3f84ae6074239 to your computer and use it in GitHub Desktop.

Select an option

Save edrex/9ad2e2f3f84ae6074239 to your computer and use it in GitHub Desktop.
Quick ES6 + SystemJS code sharing http://bl.ocks.org/edrex/9ad2e2f3f84ae6074239
<!doctype html>
<html>
<head>
<title>Hi</title>
</head>
<body>
<p>This gist is a quick way to try out and share ES6 code samples using <a href="https://gist.github.com/">Github Gist</a> and <a href="http://bl.ocks.org/">bl.ocks.org</a></p>
<p>It points at the latest System.js and Babel and loads packages through the JSPM CDN.</p>
<p>I've mangled the import paths so it imports from npm by default.</p>
<p>Just add your imports and code to main.js and publish. Enjoy!</a>
<script src="https://jspm.io/system.js"></script>
<script>
System.config({
"transpiler": "npm:babel-core",
"paths": {
"*": "https://npm.jspm.io/*.js",
"local:*": "*.js",
"github:*": "https://github.jspm.io/*.js",
"npm:*": "https://npm.jspm.io/*.js"
}
});
System.import('local:main');
</script>
</body>
</html>
import cowsay from "npm:cowsay"
function print (text) {
var node = document.createElement("pre")
node.appendChild(document.createTextNode(cowsay.say({text: text})))
document.body.appendChild(node);
}
export default print("I am a talking cow!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment