File: D:/HostingSpaces/RImmers2/portal.photomenu.nl/wwwroot/node_modules/arguejs/package.json
{
"_args": [
[
{
"raw": "arguejs@^0.2.3",
"scope": null,
"escapedName": "arguejs",
"name": "arguejs",
"rawSpec": "^0.2.3",
"spec": ">=0.2.3 <0.3.0",
"type": "range"
},
"D:\\HostingSpaces\\RImmers2\\portal.photomenu.nl\\wwwroot\\node_modules\\grpc"
]
],
"_from": "arguejs@>=0.2.3 <0.3.0",
"_id": "arguejs@0.2.3",
"_inCache": true,
"_location": "/arguejs",
"_npmUser": {
"name": "zvictor",
"email": "victor0110@msn.com"
},
"_npmVersion": "1.2.18",
"_phantomChildren": {},
"_requested": {
"raw": "arguejs@^0.2.3",
"scope": null,
"escapedName": "arguejs",
"name": "arguejs",
"rawSpec": "^0.2.3",
"spec": ">=0.2.3 <0.3.0",
"type": "range"
},
"_requiredBy": [
"/grpc"
],
"_resolved": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz",
"_shasum": "b6f939f5fe0e3cd1f3f93e2aa9262424bf312af7",
"_shrinkwrap": null,
"_spec": "arguejs@^0.2.3",
"_where": "D:\\HostingSpaces\\RImmers2\\portal.photomenu.nl\\wwwroot\\node_modules\\grpc",
"author": {
"name": "José Victor Duarte",
"url": "http://zvictor.net/"
},
"bugs": {
"url": "http://github.com/zvictor/ArgueJS/issues"
},
"contributors": [],
"dependencies": {},
"description": "ArgueJS is a library that allows you to delightfully extend your methods's signatures with optional parameters, default values and type-checking.",
"devDependencies": {
"karma": "*"
},
"directories": {
"test": "test"
},
"dist": {
"shasum": "b6f939f5fe0e3cd1f3f93e2aa9262424bf312af7",
"tarball": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz"
},
"homepage": "https://github.com/zvictor/ArgueJS#readme",
"keywords": [
"arguejs",
"argue",
"arguments",
"parameters"
],
"license": "BSD",
"main": "argue.js",
"maintainers": [
{
"name": "zvictor",
"email": "victor0110@msn.com"
}
],
"name": "arguejs",
"optionalDependencies": {},
"readme": "<p align=\"center\">\n <img src=\"https://raw.github.com/zvictor/ArgueJS/master/logo.png\" alt=\"ArgueJs\" />\n</p>\n\n**ArgueJS** is a JavaScript library that allows you to delightfully extend your method's signatures with [optional parameters](#optional-parameters),\n[default values](#default-values) and [type-checking](#type-checking).\n\n### example\nLet's suppose we want to rewrite the well known [method range](http://underscorejs.org/#range) from [underscorejs](http://underscorejs.org/#range).\n\nNote that documentation says its method signature is `range([start], stop, [step])`. With ArgueJS we could type just this way:\n```javascript\nfunction range(){ \n arguments = __({start: [Number, 0], stop: Number, step: [Number, 1]})\n\n for(var i = arguments.start; i < arguments.stop; i += arguments.step)\n console.log(i);\n}\n```\n```javascript\n>>> range(3)\n 0\n 1\n 2\n>>> range(3, 5)\n 3\n 4\n>>> range(0, 5, 2)\n 0\n 2\n 4\n```\n\n## Installation\nArgueJS is available for both node.js and the browser.\n\n###Node.js\n\nPackage is available through npm:\n\n```bash\n$ npm install arguejs\n```\n\n### Browser\n\nInclude the ArgueJS browser build in your pages.\n\n```html\n<script src=\"argue.js\" type=\"text/javascript\"></script>\n```\n\nThis will provide `__` as a global object, or `define` it if you are using AMD.\n\nThe latest version will be available for hot-linking at http://raw.github.com/zvictor/ArgueJS/master/argue.js.\nIf you prefer to host yourself, use the `argue.js` file from the root of the github project.\n\n## Getting started\n\nWhen writing your JavaScript methods with ArgueJS,\nhave in mind that you will not use conventional parameters definition as you used before.\nActually, all your methods should be defined without them.\n\nJust at the beginning of your method scope,\nyou should pass an object defining your method signature into a call to `__` and save its reference for later.\nThe signature of this method is `Object __(Object signature, [Object upperArguments])`\n\n*example:*\n```javascript\nfunction person(){\n var signature = {name: String, age: Number};\n arguments = __(signature);\n // String name is now referenced by arguments.name\n // Number age is now referenced by arguments.age\n return arguments;\n}\n```\n```javascript\n>>> person('John', 27).name\n 'John'\n>>> person('John', 27).age\n 27\n```\n\n## Propagating arguments\n\nIt **is recommended** that you explicitly pass your methods arguments through ArgueJS.\nIt is not required, unless if running in [*strict mode*](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode)\nor aiming compatibility of your code with future versions of JavaScript, then it **is required**.\n\nTo explicitly pass your methods arguments through ArgueJS,\njust pass the `arguments` variable after the `signature` description object,\nlike this example does:\n```javascript\nfunction person(){\n args = __({name: String, age: Number}, arguments);\n // ...\n```\n\nSee [how does the arguments inference works](#how-does-the-arguments-inference-works) for more.\n\n## Type-checking\n\nType-checking ensures your arguments are what you expected, and throws errors when not.\n\n*example:*\n```javascript\nfunction age(){\n arguments = __({born: Date})\n // ...\n```\n```javascript\n>>> age('01/10/1988')\n Error: parameter 'born' waiting for a Date argument but received a String\n```\n\n### Avoid type-checking\n\nThe *primitive data type* `null` can be used to allow the argument to be of **any** type.\n\n*example:*\n```javascript\nfunction book(){\n arguments = __({title: null})\n // ...\n return arguments.title;\n}\n```\n```javascript\n>>> book('Animal Farm: a Fairy Story')\n 'Animal Farm: a Fairy Story'\n>>> book(1984)\n 1984\n```\n\nThe relation of ArgueJS with `undefined` and `null` values is detail explained at our Wiki page [Null and Undefined types](https://github.com/zvictor/ArgueJS/wiki/Null-and-Undefined-types)\n\n### Data types\n* String\n* Number\n* Boolean\n* Array\n* Function\n* Object\n* Date\n* RegExp\n\n### Special data types:\n* \"global\" (or __.type.global)\n* \"Arguments\" (or __.type.Arguments)\n\n## Optional parameters\n\nOptional parameters are great to avoid a mess of conditional clauses at the beginning of your method.\nTo make a parameter optional, **declare its type inside of an Array**, like this: `{name: [String]}`\n\n*example:*\n```javascript\nfunction unique(){\n arguments = __({array: Array, isSorted: [Boolean], iterator: [Function]})\n // Array array is required\n // Boolean isSorted is optional\n // Function iterator is optional\n \n // ...\n```\nIf no value is passed to an optional parameter, then its argument value will be `undefined`.\nTo set a default value for your parameter, take a look at [default values](#default-values).\n\n### Default values\n\nWhen writing methods, sometimes you want to override the value of an undefined argument by a default value.\nThe syntax to do this is similar to [optional parameters](#optional-parameters).\nThat is because a *parameter with default value is an optional parameter* by definition.\n\nTo set a default value for a parameter **declare its type and its default value inside of an Array**,\nlike this: `{name: [String, 'unknown']}`\n\n*example:*\n```javascript\nfunction unique(){\n arguments = __({array: Array, isSorted: [Boolean, false], iterator: [Function, function(element){\n return element;\n }]})\n // Array array is required\n // Boolean isSorted is optional and its default value is false\n // Function iterator is optional and its default value is the function declared above\n \n // ...\n```\n\nIf you do not care about its type, but just want it to have a default value,\nyou should type your parameter as `undefined`\n\n*example:*\n```javascript\n arguments = __({name: [undefined, 'unknown']});\n```\n\n## Utilities\n\nSome JavaScript methods [do not work intuitively](http://webreflection.blogspot.com.br/2012/06/javascript-typeof-operator-problem.html)\nwhen dealing with types. This is why we made available these utilities methods, to help you to better deal with them.\n\n### typeof\n\nMethod that gives us the String representation of the type of a given object.\n\nConsider the following example, using the native `typeof` method:\n\n```javascript\n> function whichType() {\n return typeof this;\n}\n> [\n whichType.call(false), // \"boolean\", right? No!\n whichType.call(\"hello\"), // \"string\", right? No!\n whichType.call(123), // \"number\", right? No!\n];\n[ 'object', 'object', 'object' ]\n```\n\nReplace the function `whichType` to use ArgueJS' `__.typeof` and you will have the expected values:\n```javascript\nfunction whichType() {\n return __.typeof( this );\n}\n```\n```javascript\n[ 'Boolean', 'String', 'Number' ]\n```\n\n### getType\n\nThe method `__.getType` gives us the type class of the object we may want to inspect.\nWhy using String representations when we can access the type directly?\n\n```javascript\n\n> __.getType({key:\"value\"}) === Object\ntrue\n> constructor = __.getType(7)\n[Function: Number]\n> constructor(\"myString\") // Number(\"myString\")\nNaN\n> __.getType(this)\n[Function: global]\n```\n\n### belongs\n\nThe method `__.belongs` tells us if a given instance belongs to the given type class.\nNo excuses to compare String representations anymore!\n\n```javascript\n> __.belongs({key:\"value\"}, Object)\ntrue\n> __.belongs(this, __.type.global)\ntrue\n> __.belongs(\"value\", Number)\nfalse\n```\n\n### noConflict\n\nUtility to recover the ownership over the `__` variable.\n\n```javascript\nvar ArgueJS = __.noConflict();\n// Now, __ makes reference to its old value, the one before you added ArgueJS\n```\n\n## FAQ\n\n### How does the arguments inference works?\n\nTo automatically *infer* your method arguments, ArgueJS uses `arguments.callee` internally.\nIt is a powerful and old resource but won't be supported in future JavaScript versions anymore,\nand this is why *strict mode* disallows its use.\n\nNowadays it is present in all major browsers, although its use is not recommended in favor of better performance.\nSee its [documentation](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/arguments/callee) for even more.\n\n-------------------------------\n\n## Contributing\n\nThis project is on its very early stages and any help, suggestion or posted issue will be very appreciated.\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/zvictor/ArgueJS.git"
},
"scripts": {
"test": "karma start"
},
"version": "0.2.3"
}