Skip to content

Commit 2aad4cd

Browse files
committed
init
1 parent ec641a3 commit 2aad4cd

File tree

9 files changed

+241
-0
lines changed

9 files changed

+241
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
root = true
5+
[*]
6+
# Change these settings to your own preference
7+
indent_style = space
8+
indent_size = 2
9+
# We recommend you to keep these unchanged
10+
end_of_line = lf
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.DS_store

.jscsrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"disallowSpacesInNamedFunctionExpression": {
3+
"beforeOpeningRoundBrace": true
4+
},
5+
"disallowSpacesInFunctionExpression": {
6+
"beforeOpeningRoundBrace": true
7+
},
8+
"disallowSpacesInAnonymousFunctionExpression": {
9+
"beforeOpeningRoundBrace": true
10+
},
11+
"disallowSpacesInFunctionDeclaration": {
12+
"beforeOpeningRoundBrace": true
13+
},
14+
"disallowEmptyBlocks": true,
15+
"disallowSpacesInsideArrayBrackets": true,
16+
"disallowSpacesInsideParentheses": true,
17+
"disallowQuotedKeysInObjects": true,
18+
"disallowSpaceAfterObjectKeys": true,
19+
"disallowSpaceAfterPrefixUnaryOperators": true,
20+
"disallowSpaceBeforePostfixUnaryOperators": true,
21+
"disallowSpaceBeforeBinaryOperators": [
22+
","
23+
],
24+
"disallowMixedSpacesAndTabs": true,
25+
"disallowTrailingWhitespace": true,
26+
"disallowTrailingComma": true,
27+
"disallowYodaConditions": true,
28+
"disallowKeywords": [ "with" ],
29+
"disallowMultipleLineBreaks": true,
30+
"requireSpaceBeforeBlockStatements": true,
31+
"requireParenthesesAroundIIFE": true,
32+
"requireSpacesInConditionalExpression": true,
33+
"requireMultipleVarDecl": "false",
34+
"requireBlocksOnNewline": 1,
35+
"requireCommaBeforeLineBreak": true,
36+
"requireSpaceBeforeBinaryOperators": true,
37+
"requireSpaceAfterBinaryOperators": true,
38+
"requireCamelCaseOrUpperCaseIdentifiers": true,
39+
"requireLineFeedAtFileEnd": true,
40+
"requireCapitalizedConstructors": true,
41+
"requireDotNotation": true,
42+
"requireSpacesInForStatement": true,
43+
"requireCurlyBraces": [
44+
"do"
45+
],
46+
"requireSpaceAfterKeywords": [
47+
"if",
48+
"else",
49+
"for",
50+
"while",
51+
"do",
52+
"switch",
53+
"case",
54+
"return",
55+
"try",
56+
"catch",
57+
"typeof"
58+
],
59+
"safeContextKeyword": "_this",
60+
"validateLineBreaks": "LF",
61+
"validateQuoteMarks": "'",
62+
"validateIndentation": 2
63+
}

.jshintrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"immed": true,
8+
"latedef": true,
9+
"newcap": true,
10+
"trailing": true,
11+
"quotmark": "single",
12+
"strict": true,
13+
"multistr": true,
14+
"debug": false,
15+
"forin": true,
16+
"undef": true,
17+
"plusplus": true,
18+
"eqeqeq": true,
19+
"validthis": false,
20+
"unused": true,
21+
"jasmine": true
22+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Koemei
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
11
# gulp-node-inspector
2+
3+
A gulp node-inspector wrapper
4+
5+
Perfect for development.
6+
7+
## Usage
8+
9+
### **nodeInspector([options])**
10+
11+
You can pass an object to node-inspector with options [specified in node-inspector config](https://github.com/node-inspector/node-inspector#options).
12+
13+
## Example
14+
15+
```javascript
16+
// Gulpfile.js
17+
var gulp = require('gulp')
18+
var nodeInspector = require('gulp-node-inspector');
19+
20+
gulp.task('debug', function () {
21+
nodeInspector({
22+
'web-port': 8081,
23+
'web-host': 'localhost',
24+
'debug-port': 5082,
25+
'save-live-edit': false,
26+
preload: false,
27+
'stack-trace-limit': 4
28+
});
29+
});
30+
```
31+
32+
It works well with [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon)

index.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
var spawn = require('child_process').spawn;
5+
var gutil = require('gulp-util');
6+
7+
module.exports = function(options) {
8+
options = options || {};
9+
gulp.task('node-inspector', function(cb) {
10+
var args = [require.resolve('node-inspector/bin/inspector')];
11+
[
12+
'web-port',
13+
'web-host',
14+
'debug-port',
15+
'save-live-edit',
16+
'readTimeout',
17+
'stack-trace-limit',
18+
'preload',
19+
'hidden'
20+
].forEach(function(option) {
21+
if (option in options) {
22+
args.push('--' + option);
23+
if (option === 'hidden') {
24+
args.push(JSON.stringify(options[option]));
25+
return;
26+
}
27+
args.push(options[option]);
28+
}
29+
});
30+
var child = spawn('node', args, {
31+
stdio: 'inherit'
32+
});
33+
child.on('error', function(err) {
34+
gutil.log(gutil.colors.red('node-inspector error: ' + err.message));
35+
});
36+
child.on('exit', function() {
37+
gutil.log(gutil.colors.red('node-inspector process stopped'));
38+
});
39+
// calling callback for alerting gulp that the task is finished, probably we should do better.
40+
cb();
41+
});
42+
};

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "gulp-node-inspector",
3+
"version": "0.0.1",
4+
"description": "Run node inspector from your gulp build.",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "./node_modules/.bin/mocha"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/koemei/gulp-node-inspector.git"
12+
},
13+
"keywords": [
14+
"gulpplugin",
15+
"node-inspector",
16+
"debug"
17+
],
18+
"author": "Koemei",
19+
"contributors": [
20+
{
21+
"name": "Alessandro Arnodo",
22+
"email": "alessandro@arnodo.net"
23+
}
24+
],
25+
"license": "MIT",
26+
"bugs": {
27+
"url": "https://github.com/koemei/gulp-node-inspector/issues"
28+
},
29+
"homepage": "https://github.com/koemei/gulp-node-inspector",
30+
"dependencies": {
31+
"gulp-util": "~3.0.2",
32+
"node-inspector": "~0.8.3"
33+
},
34+
"devDependencies": {
35+
"mocha": "~2.1.0"
36+
}
37+
}

test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
var assert = require('assert');
4+
5+
it('should run node-inspector', function () {
6+
console.log('TODO');
7+
assert.equal(true, true);
8+
});

0 commit comments

Comments
 (0)