Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vesparny committed Jan 16, 2015
1 parent ec641a3 commit 2aad4cd
Show file tree
Hide file tree
Showing 9 changed files with 241 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_store
63 changes: 63 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowYodaConditions": true,
"disallowKeywords": [ "with" ],
"disallowMultipleLineBreaks": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireMultipleVarDecl": "false",
"requireBlocksOnNewline": 1,
"requireCommaBeforeLineBreak": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"requireSpacesInForStatement": true,
"requireCurlyBraces": [
"do"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"typeof"
],
"safeContextKeyword": "_this",
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"validateIndentation": 2
}
22 changes: 22 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"node": true,
"browser": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"immed": true,
"latedef": true,
"newcap": true,
"trailing": true,
"quotmark": "single",
"strict": true,
"multistr": true,
"debug": false,
"forin": true,
"undef": true,
"plusplus": true,
"eqeqeq": true,
"validthis": false,
"unused": true,
"jasmine": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Koemei

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.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# gulp-node-inspector

A gulp node-inspector wrapper

Perfect for development.

## Usage

### **nodeInspector([options])**

You can pass an object to node-inspector with options [specified in node-inspector config](https://github.com/node-inspector/node-inspector#options).

## Example

```javascript
// Gulpfile.js
var gulp = require('gulp')
var nodeInspector = require('gulp-node-inspector');

gulp.task('debug', function () {
nodeInspector({
'web-port': 8081,
'web-host': 'localhost',
'debug-port': 5082,
'save-live-edit': false,
preload: false,
'stack-trace-limit': 4
});
});
```

It works well with [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon)
42 changes: 42 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

var gulp = require('gulp');
var spawn = require('child_process').spawn;
var gutil = require('gulp-util');

module.exports = function(options) {
options = options || {};
gulp.task('node-inspector', function(cb) {
var args = [require.resolve('node-inspector/bin/inspector')];
[
'web-port',
'web-host',
'debug-port',
'save-live-edit',
'readTimeout',
'stack-trace-limit',
'preload',
'hidden'
].forEach(function(option) {
if (option in options) {
args.push('--' + option);
if (option === 'hidden') {
args.push(JSON.stringify(options[option]));
return;
}
args.push(options[option]);
}
});
var child = spawn('node', args, {
stdio: 'inherit'
});
child.on('error', function(err) {
gutil.log(gutil.colors.red('node-inspector error: ' + err.message));
});
child.on('exit', function() {
gutil.log(gutil.colors.red('node-inspector process stopped'));
});
// calling callback for alerting gulp that the task is finished, probably we should do better.
cb();
});
};
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "gulp-node-inspector",
"version": "0.0.1",
"description": "Run node inspector from your gulp build.",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/koemei/gulp-node-inspector.git"
},
"keywords": [
"gulpplugin",
"node-inspector",
"debug"
],
"author": "Koemei",
"contributors": [
{
"name": "Alessandro Arnodo",
"email": "[email protected]"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/koemei/gulp-node-inspector/issues"
},
"homepage": "https://github.com/koemei/gulp-node-inspector",
"dependencies": {
"gulp-util": "~3.0.2",
"node-inspector": "~0.8.3"
},
"devDependencies": {
"mocha": "~2.1.0"
}
}
8 changes: 8 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var assert = require('assert');

it('should run node-inspector', function () {
console.log('TODO');
assert.equal(true, true);
});

0 comments on commit 2aad4cd

Please sign in to comment.