Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 64e0d0f6ad3865e32af8926507a04d1d8404052c @doug-martin committed Jan 16, 2013
@@ -0,0 +1,2 @@
+.idea
+node_modules
@@ -0,0 +1,74 @@
+{
+ "predef": [
+ "jasmine",
+ "spyOn",
+ "it",
+ "console",
+ "describe",
+ "expect",
+ "beforeEach",
+ "afterEach",
+ "waits",
+ "waitsFor",
+ "runs",
+ "$",
+ "jQuery",
+ "_",
+ "require",
+ "define",
+ "sinon",
+ "thumbs"
+ ],
+
+ "node" : true,
+ "browser" : true,
+ "devel" : true,
+ "jquery" : true,
+
+ "bitwise" : false,
+ "camelcase" : true,
+ "curly" : true,
+ "eqeqeq" : true,
+ "forin" : false,
+ "immed" : true,
+ "indent" : 4,
+ "latedef" : true,
+ "newcap" : true,
+ "noarg" : true,
+ "noempty" : true,
+ "nonew" : false,
+ "plusplus" : false,
+ "quotmark" : false,
+ "regexp" : false,
+ "undef" : true,
+ "unused" : false,
+ "strict" : false,
+ "trailing" : true,
+ "white" : false,
+
+ "asi" : false,
+ "boss" : false,
+ "debug" : false,
+ "eqnull" : true,
+ "es5" : true,
+ "esnext" : true,
+ "evil" : false,
+ "expr" : true,
+ "funcscope" : false,
+ "globalstrict" : false,
+ "iterator" : false,
+ "lastsemic" : false,
+ "laxbreak" : false,
+ "laxcomma" : false,
+ "loopfunc" : false,
+ "multistr" : false,
+ "onecase" : false,
+ "proto" : false,
+ "regexdash" : false,
+ "scripturl" : false,
+ "smarttabs" : false,
+ "shadow" : false,
+ "sub" : true,
+ "supernew" : true,
+ "validthis" : false
+}
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
21 LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2011-2012 Pollenware
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
124 README.md
@@ -0,0 +1,124 @@
+[![build status](https://secure.travis-ci.org/doug-martin/extended.png)](http://travis-ci.org/doug-martin/extended)
+
+# extended
+
+`extended` is a wrapper than sits on top of [`extender`](https://github.com/doug-martin/extender) than allows you to combine multiple libraries into a single API.
+
+This allows you create a feature rich API that only includes the functionality that you wish to have.
+
+Extended is also browser friendly so you can create a utility library that is reusable on both in node and the browser.
+
+## Why?
+
+Often times the libraries I end up using quite a few libraries in a single node project, this allows you to seamlessly integrate libraries into a single interface.
+
+You also get the added benefit of replacing libraries without having to change you code every place that they were required.
+
+
+## Installation
+
+```
+npm install extended
+```
+
+Or [download the source](https://raw.github.com/doug-martin/extended/master/index.js) ([minified](https://raw.github.com/doug-martin/extended/master/extended.min.js))
+
+## Usage
+
+
+**`register`**
+
+The register method allows you to register a library with extended.
+
+The following example makes use of
+
+* [`array-extended`](https://github.com/doug-martin/array-extended)
+* [`string-extended`](https://github.com/doug-martin/array-extended)
+* [`date-extended`](https://github.com/doug-martin/array-extended)
+* [`function-extended`](https://github.com/doug-martin/array-extended)
+* [`is-extended`](https://github.com/doug-martin/array-extended)
+* [`object-extended`](https://github.com/doug-martin/array-extended)
+* [`promise-extended`](https://github.com/doug-martin/array-extended)
+
+
+**Notice** how all the APIs are completely integrated together, so you can use the chaining API from each registered library in a single unified interface.
+
+```javascript
+
+var _ = extended
+ .register(require("array-extended")
+ .register(require("string-extended")
+ .register(require("date-extended")
+ .register(require("function-extended")
+ .register(require("is-extended")
+ .register(require("object-extended")
+ .register(require("promise-extended");
+
+//now use your API!
+
+//from is-extended
+_.isArray([]); //true
+
+//from string-extended
+_.format("{first} {last}", {first : "Bob", last : "yukon"});
+
+//combination of object-extended, array-extended, and string-extended
+_({hello : "hello", "world"}).keys().map(function(key, index){
+ return _.format("%d key is %s", index + 1, key");
+}).value().join(";"); //"1 key is hello; 2 key is world"
+
+
+```
+
+If you want to namespace you API you can provide an alias.
+
+
+
+```javascript
+
+var _ = extended
+ .register("array", require("array-extended")
+ .register("string", require("string-extended")
+ .register("date", require("date-extended")
+ .register("fn", require("function-extended")
+ .register("is", require("is-extended")
+ .register("obj", require("object-extended")
+ .register("promise", require("promise-extended");
+
+//now use your API!
+
+//from is-extended
+_.is.isArray([]); //true
+
+//from string-extended
+_.string.format("{first} {last}", {first : "Bob", last : "yukon"});
+
+```
+
+### Integration with other libraries.
+
+You can also integrate other libraries by just mixing in their functions.
+
+Suppose you dont want to use `promise-extended` but instead `Q`.
+
+```
+var _ = extended
+ .register(require("array-extended")
+ .register(require("string-extended")
+ .register(require("date-extended")
+ .register(require("function-extended")
+ .register(require("is-extended")
+ .register(require("object-extended")
+ .register(require("q");
+
+_.resolve("hello").then(function(hello){
+ console.log("hello");
+})
+```
+
+
+
+
+
+
+
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Mixin Example</title>
+</head>
+<body onload="init()">
+
+<div id="output"></div>
+
+<script type="text/javascript" src="./scripts/declare.js"></script>
+<script type="text/javascript" src="./scripts/extender.js"></script>
+<script type="text/javascript" src="../../index.js"></script>
+<script type="text/javascript" src="./scripts/extended1.js"></script>
+<script type="text/javascript" src="./scripts/extended2.js"></script>
+<script type="text/javascript">
+
+ var outputDiv = document.getElementById("output");
+
+ function log(str) {
+ outputDiv.innerText += str + "\n";
+ }
+
+
+ function init() {
+ log(extended.isString(""));
+ log(extended("hello").isString().value());
+ log(extended.multiply("hello", 5));
+ log(extended("hello").multiply(5).value());
+ }
+
+</script>
+
+</body>
+</html>
Oops, something went wrong.

0 comments on commit 64e0d0f

Please sign in to comment.