tempjs.org

tempjs.org is a really tiny website that lets you store small snippets of JavaScript for brief periods of time along with an auto-generated HTML page that just loads that JavaScript file and nothing else.

API

var request = require('then-request');
request('POST', 'https://tempjs.org/create', {
  json: {
    script: "var p = document.createElement('p');\n" +
            "p.textContent = 'Hello World';\n" +
            "document.body.appendChild(p);"
  }
}).getBody('utf8').then(JSON.parse).done(function (res) {
  assert(res.id === '36e5035e7b364d50d547c22c5b2ba78c9736acfc');
  assert(res.path === '/files/36e5035e7b364d50d547c22c5b2ba78c9736acfc/index.html');
  console.log('https://tempjs.org' + res.path);
});
var request = require('then-request');
request('POST', 'https://tempjs.org/create', {
  json: {
    html: '{{styles}}

My Page

{{scripts}}', stylesheets: [ 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css' ], style: 'h1 { color: red; }', script: "$('body').append('

Hello World

');", libraries: [ 'https://code.jquery.com/jquery-2.1.3.min.js' ] } }).getBody('utf8').then(JSON.parse).done(function (res) { assert(res.id === '875d4cfcbfb3b563523cbd5c6b0ad86eb57d32e2'); assert(res.path === '/files/875d4cfcbfb3b563523cbd5c6b0ad86eb57d32e2/index.html'); console.log('https://tempjs.org' + res.path); });

You can also add html to override the default HTML, just make sure you put {{scripts}} somewhere in your template or your JavaScript will not be included.

Try it out!

Contact Details

If you notice anything wrong with this website, you can contact me at .