Skip to content

Commit

Permalink
Scaffold: Normalize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 10, 2018
1 parent 39b6da5 commit 01715ea
Show file tree
Hide file tree
Showing 27 changed files with 340 additions and 323 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "gulp"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
32 changes: 21 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
# Logs
logs
*.log
npm-debug.log*

# Coverage directories and files used by tools like nyc
# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output
.coveralls.yml

# Dependency directories
node_modules
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Optional npm cache directory
.npm
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Files generated by platform.
.DS_Store
# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# npm lock file
package-lock.json
# Users Environment Variables
.lock-wscript

# Garbage files
.DS_Store
59 changes: 0 additions & 59 deletions .jscsrc

This file was deleted.

11 changes: 0 additions & 11 deletions .jshintrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
23 changes: 12 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ sudo: false
language: node_js

node_js:
- "0.10"
- "0.12"
- "4"
- "6"
- "8"
- '10'
- '8'
- '6'
- '4'
- '0.12'
- '0.10'

matrix:
fast_finish: true

script: if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -ge 4 ]; then
npm run cover;
else
npm test;
fi

script:
if [ $(echo "${TRAVIS_NODE_VERSION}" | cut -d'.' -f1) -ge 4 ]; then
npm run coveralls;
else
npm test;
fi
37 changes: 18 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Copyright (c) 2014 Tyler Kellen
The MIT License (MIT)

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:
Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 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.
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.
42 changes: 30 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# flagged-respawn [![Build Status](https://secure.travis-ci.org/js-cli/js-flagged-respawn.svg)](http://travis-ci.org/js-cli/js-flagged-respawn)
> A tool for respawning node binaries when special flags are present.
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>

[![NPM](https://nodei.co/npm/flagged-respawn.png)](https://nodei.co/npm/flagged-respawn/)
# flagged-respawn

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

A tool for respawning node binaries when special flags are present.

## What is it?

Expand Down Expand Up @@ -72,22 +79,33 @@ If `--no-respawning` flag is given in *argv*, this function does not respawned e
* **<u><i>callback</i>(ready, proc, argv) : Void</u>**

*callback* function is called both when respawned or not, and it can be distinguished by callback's argument: *ready*. (*ready* indicates whether a process spawned its child process (false) or not (true), but it does not indicate whether a process is a spawned child process or not. *ready* for a spawned child process is true.)

*argv* is an array of command line arguments which is respawned (when *ready* is false) or is passed current process except flags within *flags* and `--no-respawning` (when *ready* is true).

**Parameter:**

| Parameter | Type | Description |
|:----------|:-------:|:--------------------------|
| *ready* | boolean | True, if not respawning and is ready to execute main function. |
| *proc* | object | Child process object if respawned, otherwise current process object. |
| *argv* | Array | An array of command line arguments. |

## Release History
## License

MIT

[downloads-image]: http://img.shields.io/npm/dm/flagged-respawn.svg
[npm-url]: https://www.npmjs.com/package/flagged-respawn
[npm-image]: http://img.shields.io/npm/v/flagged-respawn.svg

[travis-url]: https://travis-ci.org/gulpjs/flagged-respawn
[travis-image]: http://img.shields.io/travis/gulpjs/flagged-respawn.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/flagged-respawn
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/flagged-respawn.svg?label=appveyor

[coveralls-url]: https://coveralls.io/r/gulpjs/flagged-respawn
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/flagged-respawn/master.svg

* 2017-12-16 - v1.0.0 - Force/Forbid respawn, Improved API & testing
* 2016-03-22 - v0.3.2 - fix issue with v8 flags values being dropped
* 2014-09-12 - v0.3.1 - use `{ stdio: 'inherit' }` for spawn to maintain colors
* 2014-09-11 - v0.3.0 - for real this time
* 2014-09-11 - v0.2.0 - cleanup
* 2014-09-04 - v0.1.1 - initial release
[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# http://www.appveyor.com/docs/appveyor-yml
# http://www.appveyor.com/docs/lang/nodejs-iojs

environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- node --version
- npm --version
- cmd: npm test

build: off

# build version format
version: "{build}"
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const reorder = require('./lib/reorder');
const respawn = require('./lib/respawn');
const remover = require('./lib/remover');
var reorder = require('./lib/reorder');
var respawn = require('./lib/respawn');
var remover = require('./lib/remover');

const FORBID_RESPAWNING_FLAG = '--no-respawning';
var FORBID_RESPAWNING_FLAG = '--no-respawning';

module.exports = function (flags, argv, forcedFlags, execute) {
module.exports = function(flags, argv, forcedFlags, execute) {
if (!flags) {
throw new Error('You must specify flags to respawn with.');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/remover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const isV8flags = require('./is-v8flags');
var isV8flags = require('./is-v8flags');

module.exports = function(flags, argv) {
var args = argv.slice(0, 1);
Expand Down
6 changes: 3 additions & 3 deletions lib/reorder.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const isV8flags = require('./is-v8flags');
var isV8flags = require('./is-v8flags');

module.exports = function (flags, argv) {
module.exports = function(flags, argv) {
if (!argv) {
argv = process.argv;
}
var args = [argv[1]];
argv.slice(2).forEach(function (arg) {
argv.slice(2).forEach(function(arg) {
var flag = arg.split('=')[0];
if (isV8flags(flag, flags)) {
args.unshift(arg);
Expand Down
8 changes: 4 additions & 4 deletions lib/respawn.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const spawn = require('child_process').spawn;
var spawn = require('child_process').spawn;

module.exports = function (argv) {
module.exports = function(argv) {
var child = spawn(argv[0], argv.slice(1), { stdio: 'inherit' });
child.on('exit', function (code, signal) {
process.on('exit', function () {
child.on('exit', function(code, signal) {
process.on('exit', function() {
/* istanbul ignore if */
if (signal) {
process.kill(process.pid, signal);
Expand Down
Loading

0 comments on commit 01715ea

Please sign in to comment.