Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 00e00f2
Showing
5 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2013 Mashdraggin | ||
|
||
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. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### helpers | ||
helper functions for node.js | ||
####installation | ||
npm install helpers |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/// <reference path="../nodelib/node.js" /> | ||
var path = require('path'); | ||
|
||
module.exports = function (filepath, _exports) { | ||
/// <summary>Helper functions for requiring Node.js modules.</summary> | ||
/// <param name="filepath" type="String">The filepath of the current module.</param> | ||
/// <param name="_exports" type="Object">The _exports property of the current module.</param> | ||
/// <returns type="Object">Helper-methods object.</returns> | ||
|
||
var dirname = filepath || process.cwd(); | ||
|
||
function submodule(name) { | ||
/// <summary>Require a local Node.js module file.</summary> | ||
/// <param name="name" type="String">The filename of the module.</param> | ||
/// <returns type="Object">The Node.js module.</returns> | ||
return require(path.resolve(dirname + path.sep + name)); | ||
} | ||
|
||
function exp(name) { | ||
/// <summary>Export a local module file as a property.</summary> | ||
/// <param name="name" type="String">The filename of the module.</param> | ||
_exports[name] = submodule(name); | ||
} | ||
|
||
function mixin(name, excludeNs) { | ||
/// <summary>Mixin a local module file's methods with root namespace.</summary> | ||
/// <param name="name" type="String">The filename of the module.</param> | ||
/// <param name="excludeNs" type="Boolean" optional="true">Whether to export module as a namespace also (default is true).</param> | ||
var sub = submodule(name); | ||
for (var key in sub) { | ||
if (sub.hasOwnProperty(key)) { | ||
_exports[key] = sub[key]; | ||
} | ||
} | ||
if (!excludeNs) { | ||
// include methods in namespaced module | ||
exp(name); | ||
} | ||
} | ||
|
||
return { | ||
sub: submodule, | ||
exp: exp, | ||
mixin: mixin | ||
}; | ||
|
||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ 'node', | ||
1 verbose cli 'N:\\npm\\node_modules\\npm\\bin\\npm-cli.js', | ||
1 verbose cli 'install', | ||
1 verbose cli 'helpers' ] | ||
2 info using npm@1.2.3 | ||
3 info using node@v0.8.15 | ||
4 verbose read json Z:\node-helpers\package.json | ||
5 verbose read json Z:\node-helpers\package.json | ||
6 verbose cache add [ 'helpers', null ] | ||
7 verbose cache add name=undefined spec="helpers" args=["helpers",null] | ||
8 verbose parsed url { pathname: 'helpers', path: 'helpers', href: 'helpers' } | ||
9 silly lockFile 43a62a8c-helpers helpers | ||
10 verbose lock helpers C:\Users\Nathan\AppData\Roaming\npm-cache\43a62a8c-helpers.lock | ||
11 silly lockFile 43a62a8c-helpers helpers | ||
12 verbose addNamed [ 'helpers', '' ] | ||
13 verbose addNamed [ null, '' ] | ||
14 silly lockFile a174c35b-helpers helpers@ | ||
15 verbose lock helpers@ C:\Users\Nathan\AppData\Roaming\npm-cache\a174c35b-helpers.lock | ||
16 silly addNameRange { name: 'helpers', range: '', hasData: false } | ||
17 verbose url raw helpers | ||
18 verbose url resolving [ 'https://registry.npmjs.org/', './helpers' ] | ||
19 verbose url resolved https://registry.npmjs.org/helpers | ||
20 info trying registry request attempt 1 at 23:56:51 | ||
21 http GET https://registry.npmjs.org/helpers | ||
22 http 404 https://registry.npmjs.org/helpers | ||
23 silly registry.get cb [ 404, | ||
23 silly registry.get { server: 'CouchDB/1.2.1 (Erlang OTP/R15B03)', | ||
23 silly registry.get date: 'Tue, 26 Feb 2013 05:56:53 GMT', | ||
23 silly registry.get 'content-type': 'application/json', | ||
23 silly registry.get 'content-length': '52', | ||
23 silly registry.get 'cache-control': 'must-revalidate' } ] | ||
24 silly lockFile a174c35b-helpers helpers@ | ||
25 error 404 'helpers' is not in the npm registry. | ||
25 error 404 You should bug the author to publish it | ||
25 error 404 | ||
25 error 404 Note that you can also install from a | ||
25 error 404 tarball, folder, or http url, or git url. | ||
26 error System Windows_NT 6.1.7601 | ||
27 error command "node" "N:\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "helpers" | ||
28 error cwd Z:\node-helpers | ||
29 error node -v v0.8.15 | ||
30 error npm -v 1.2.3 | ||
31 error code E404 | ||
32 verbose exit [ 1, true ] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"helpers","description":"helper functions for node.js","version":"0.0.1","author":"Mashdraggin","license":"MIT","repository":{"type":"git","url":"https://github.com/fshost/helpers.git"},"scripts":{"test":"node ./test/test"},"readme":"### helpers\nhelper functions for node.js\n####installation\nnpm install helpers","readmeFilename":"README.md"} |