Created
April 1, 2012 18:30
-
-
Save CrabDude/2277550 to your computer and use it in GitHub Desktop.
Tiki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script>eval(localStorage.tiki)||function(q,l){(tiki=function(){q.push(arguments)}).q=q;(l||attachEvent)((l?"":"on")+"message",function(e){eval(e.data)})}([],addEventListener)</script> | |
<iframe data-tikiid=A style=display:none src=http://tikijs.net></iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See Asynchronous Module Definition (AMD) spec | |
// https://github.com/amdjs/amdjs-api/wiki/AMD | |
define('foo', ['bar', 'baz'], function(bar, baz) { | |
// Your code here | |
return { | |
id: 'foo', | |
bar: bar, | |
baz: baz | |
}; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "name" : "foo", | |
"version" : "1.2.3", | |
"description" : "A packaged foo fooer for fooing foos", | |
"main" : "foo.js", | |
"dependencies": { | |
"bar": "0.1.x", | |
"baz": "*" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Point npm to the tiki registry (3 options) | |
# option 1: | |
# to revert, comment out or delete line | |
echo "registry = "http://tikijs.net:5984/registry/_design/app/_rewrite" >> ~/.npmrc | |
# option 2: | |
# to revert, "npm config delete registry" | |
npm config set registry http://tikijs.net:5984/registry/_design/app/_rewrite | |
# option 3: | |
npm --registry http://tikijs.net:5984/registry/_design/app/_rewrite install <package> | |
# Publish as you would with npm | |
path/to/module$ npm publish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Effortless module loading [1] | |
tiki(['jquery'], function(require, define) { | |
var jquery = require('jquery') | |
console.log('Tiki!Tiki! ', jquery) | |
}) | |
// Automatic dependency resolution | |
// Loading underscore.string[2] includes & loads underscore | |
tiki(['underscore.string'], function(require, define) { | |
var _ = require('underscore.string') | |
console.log(_.repeat("Tiki!", 2)) | |
}) | |
// [1] http://jquery.com/ | |
// [2] http://epeli.github.com/underscore.string/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment