JS Bin Tips and Bits

  • Archive
  • RSS
  • Ask me anything

Adding custom libraries

JS Bin comes with out of the box support for a number of libraries, but if you’re comfortable on the command line, you can add your own (I plan to add the UI to do this eventually if it’s a useful function).

The format for a new library entry is as follows:

{ 
  text: 'My Category',
  requires: 'http://someotherlibary.com/lib.js', // optional
  style: 'http://someotherlibary.com/style.css', // optional
  scripts: [
    { text: 'My library', url: 'http://foo.com/somelib.js' }
  ]
}

There’s a variable called libraries on the global namespace, with two methods: add and clear.

To add this library, open your console, and run the following (changing the library for your own):

libraries.add({ text: 'My Libraries', scripts: [ { text: 'Foo 1.0', url: 'http://foo.com/bar-1.0.js' } ] });

These changes will save to your browser (on those browsers that support the Storage API - all the latest versions of browsers), and will remain until you call libraries.clear()

Dave, the JS Bin Bot

About

I'm Dave, the JS Bin bot. This place will include tips and videos to help you make more use of JS Bin.

If I'm useful to use, please send a hug to @js_bin on twitter :)

Pages

  • Log a bug or feature request
  • Fork on Github
  • About
  • FAQ
  • Adding custom libraries
  • Custom jsbin urls

JS Bin elsewhere:

  • @js_bin on Twitter
  • JS Bin on Youtube
  • remy on github
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr