arnaucube
arnaucube/socketioMEANseedPublic Self-hosted repository
socketioMEANseed/server/node_modules/better-assert/Readme.md
server/node_modules/better-assert/Readme.mdRaw
 1
 2# better-assert
 3
 4  Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for
 5  self-documenting failure messages.
 6
 7## Installation
 8
 9    $ npm install better-assert
10
11## Example
12
13 By default assertions are enabled, however the __NO_ASSERT__ environment variable 
14 will deactivate them when truthy.
15
16```js
17var assert = require('better-assert');
18
19test();
20
21function test() {
22  var user = { name: 'tobi' };
23  assert('tobi' == user.name);
24  assert('number' == typeof user.age);
25}
26
27AssertionError: 'number' == typeof user.age
28    at test (/Users/tj/projects/better-assert/example.js:9:3)
29    at Object.<anonymous> (/Users/tj/projects/better-assert/example.js:4:1)
30    at Module._compile (module.js:449:26)
31    at Object.Module._extensions..js (module.js:467:10)
32    at Module.load (module.js:356:32)
33    at Function.Module._load (module.js:312:12)
34    at Module.runMain (module.js:492:10)
35    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
36```
37
38## License 
39
40(The MIT License)
41
42Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
43
44Permission is hereby granted, free of charge, to any person obtaining
45a copy of this software and associated documentation files (the
46'Software'), to deal in the Software without restriction, including
47without limitation the rights to use, copy, modify, merge, publish,
48distribute, sublicense, and/or sell copies of the Software, and to
49permit persons to whom the Software is furnished to do so, subject to
50the following conditions:
51
52The above copyright notice and this permission notice shall be
53included in all copies or substantial portions of the Software.
54
55THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
56EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
57MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
58IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
59CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
60TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
61SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.