{
  "_id": "exit-x",
  "maintainers": [
    {
      "name": "krinkle",
      "email": "krinkle@fastmail.com"
    },
    {
      "name": "vladikoff",
      "email": "vlad@vladikoff.com"
    },
    {
      "name": "xhmikosr",
      "email": "xhmikosr@gmail.com"
    }
  ],
  "keywords": [
    "exit",
    "process",
    "stdio",
    "stdout",
    "stderr",
    "drain",
    "flush",
    "3584"
  ],
  "dist-tags": {
    "latest": "0.2.2"
  },
  "author": {
    "name": "Grunt Development Team",
    "url": "https://gruntjs.com/development-team"
  },
  "_rev": "3-d51281a8f87369fd9e8628324ab3a1b0",
  "description": "A replacement for process.exit that ensures stdio are fully drained before exiting.",
  "readme": "# exit-x\n\nFork of unmaintained https://github.com/cowboy/node-exit\n\nA replacement for process.exit that ensures stdio are fully drained before exiting.\n\nTo make a long story short, if `process.exit` is called on Windows, script output is often truncated when pipe-redirecting `stdout` or `stderr`. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling `process.exit`.\n\nSee [Node.js issue #3584](https://github.com/joyent/node/issues/3584) for further reference.\n\nTested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18.\n\nBased on some code by [@vladikoff](https://github.com/vladikoff).\n\n## Getting Started\n\nInstall the module with: `npm install exit`\n\n```javascript\nvar exit = require(\"exit\");\n\n// These lines should appear in the output, EVEN ON WINDOWS.\nconsole.log(\"omg\");\nconsole.error(\"yay\");\n\n// process.exit(5);\nexit(5);\n\n// These lines shouldn't appear in the output.\nconsole.log(\"wtf\");\nconsole.error(\"bro\");\n```\n\n## Don't believe me? Try it for yourself.\n\nIn Windows, clone the repo and cd to the `test\\fixtures` directory. The only difference between [log.js](test/fixtures/log.js) and [log-broken.js](test/fixtures/log-broken.js) is that the former uses `exit` while the latter calls `process.exit` directly.\n\nThis test was done using cmd.exe, but you can see the same results using `| grep \"std\"` in either PowerShell or git-bash.\n\n```\nC:\\node-exit\\test\\fixtures>node log.js 0 10 stdout stderr 2>&1 | find \"std\"\nstdout 0\nstderr 0\nstdout 1\nstderr 1\nstdout 2\nstderr 2\nstdout 3\nstderr 3\nstdout 4\nstderr 4\nstdout 5\nstderr 5\nstdout 6\nstderr 6\nstdout 7\nstderr 7\nstdout 8\nstderr 8\nstdout 9\nstderr 9\n\nC:\\node-exit\\test\\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find \"std\"\n\nC:\\node-exit\\test\\fixtures>\n```\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n2013-11-26 - v0.1.2 - Fixed a bug with hanging processes.  \n2013-09-26 - v0.1.1 - Fixed some bugs. It seems to actually work now!  \n2013-09-20 - v0.1.0 - Initial release.\n\n## License\n\nCopyright (c) 2013 \"Cowboy\" Ben Alman  \nLicensed under the MIT license.\n",
  "repository": {
    "type": "git",
    "url": "git://github.com/gruntjs/node-exit-x.git"
  },
  "bugs": {
    "url": "https://github.com/gruntjs/node-exit-x/issues"
  },
  "license": "MIT",
  "versions": {
    "0.2.1": {
      "name": "exit-x",
      "version": "0.2.1",
      "keywords": [
        "exit",
        "process",
        "stdio",
        "stdout",
        "stderr",
        "drain",
        "flush",
        "3584"
      ],
      "author": {
        "url": "https://gruntjs.com/development-team",
        "name": "Grunt Development Team"
      },
      "license": "MIT",
      "_id": "exit-x@0.2.1",
      "maintainers": [
        {
          "name": "vladikoff",
          "email": "vlad@vladikoff.com"
        }
      ],
      "homepage": "https://github.com/cowboy/node-exit",
      "bugs": {
        "url": "https://github.com/gruntjs/node-exit/issues"
      },
      "dist": {
        "shasum": "271c2c176ca482073fbb12648611412c1c159430",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/exit-x/-/exit-x-0.2.1.tgz",
        "fileCount": 20,
        "integrity": "sha512-MNUFK069jLtwkmyHiWptU6H95D1I4wHKNPHs+Y6NDu6RzIGYRBfllRwvI6oA1xbfXT2pWspZqjeIeNjh6tIOog==",
        "signatures": [
          {
            "sig": "MEYCIQDFhwrDir9AEh2jjx60z030+tOW8DYwGp06tDp/mxrnAgIhALgK/7PkpXrP0fKjLSwhWqrGB4Jo5bDsWyarjwwtazO8",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ],
        "unpackedSize": 60484
      },
      "main": "lib/exit",
      "engines": {
        "node": ">= 0.8.0"
      },
      "gitHead": "0947a0618aff1d239f59cac7c0f550895f00758c",
      "scripts": {
        "test": "grunt nodeunit"
      },
      "_npmUser": {
        "name": "vladikoff",
        "email": "vlad@vladikoff.com"
      },
      "repository": {
        "url": "git://github.com/gruntjs/node-exit-x.git",
        "type": "git"
      },
      "_npmVersion": "10.7.0",
      "description": "A replacement for process.exit that ensures stdio are fully drained before exiting.",
      "directories": {},
      "_nodeVersion": "20.15.1",
      "_hasShrinkwrap": false,
      "devDependencies": {
        "grunt": "~0.4.1",
        "which": "~1.0.5",
        "grunt-cli": "^1.5.0",
        "grunt-contrib-watch": "~0.5.3",
        "grunt-contrib-jshint": "~0.6.4",
        "grunt-contrib-nodeunit": "~0.2.0"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/exit-x_0.2.1_1730588690704_0.8830793209590027",
        "host": "s3://npm-registry-packages"
      }
    },
    "0.2.2": {
      "name": "exit-x",
      "description": "A replacement for process.exit that ensures stdio are fully drained before exiting.",
      "version": "0.2.2",
      "homepage": "https://github.com/gruntjs/node-exit-x",
      "author": {
        "name": "Grunt Development Team",
        "url": "https://gruntjs.com/development-team"
      },
      "repository": {
        "type": "git",
        "url": "git://github.com/gruntjs/node-exit-x.git"
      },
      "bugs": {
        "url": "https://github.com/gruntjs/node-exit-x/issues"
      },
      "license": "MIT",
      "main": "lib/exit.js",
      "types": "lib/exit.d.ts",
      "engines": {
        "node": ">= 0.8.0"
      },
      "scripts": {
        "test": "grunt nodeunit"
      },
      "devDependencies": {
        "grunt": "~0.4.1",
        "grunt-cli": "^1.5.0",
        "grunt-contrib-jshint": "~0.6.4",
        "grunt-contrib-nodeunit": "~0.2.0",
        "grunt-contrib-watch": "~0.5.3",
        "which": "~1.0.5"
      },
      "keywords": [
        "exit",
        "process",
        "stdio",
        "stdout",
        "stderr",
        "drain",
        "flush",
        "3584"
      ],
      "_id": "exit-x@0.2.2",
      "gitHead": "502e7a24cc3580367fa81b86ab5ea4d9c4263d4c",
      "_nodeVersion": "20.15.1",
      "_npmVersion": "10.7.0",
      "dist": {
        "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==",
        "shasum": "1f9052de3b8d99a696b10dad5bced9bdd5c3aa64",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/exit-x/-/exit-x-0.2.2.tgz",
        "fileCount": 21,
        "unpackedSize": 60764,
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQCN92J5WnGyIQugyYPPjQ2mtymXatvBOq9jH3eoFW+eIgIgEsRGgx5qz3QtVjh306R5JLsBjlMPX7EnFRFLjLO8RrA="
          }
        ]
      },
      "_npmUser": {
        "name": "vladikoff",
        "email": "vlad@vladikoff.com"
      },
      "directories": {},
      "maintainers": [
        {
          "name": "krinkle",
          "email": "krinkle@fastmail.com"
        },
        {
          "name": "vladikoff",
          "email": "vlad@vladikoff.com"
        },
        {
          "name": "xhmikosr",
          "email": "xhmikosr@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/exit-x_0.2.2_1733322175738_0.7252365369044136"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "exit-x",
  "time": {
    "created": "2024-11-02T23:04:50.703Z",
    "modified": "2026-06-01T05:51:12.749Z",
    "0.2.1": "2024-11-02T23:04:50.996Z",
    "0.2.2": "2024-12-04T14:22:55.906Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/gruntjs/node-exit-x"
}