{
	"name": "semaphore",
	"versions": {
		"1.0.0": {
			"name": "semaphore",
			"version": "1.0.0",
			"description": "semaphore for node",
			"engine": "node >= 0.6.0",
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "1.0.x",
				"should": "0.6.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"_npmUser": {
				"name": "abrkn",
				"email": "andreas@opuno.com"
			},
			"_id": "semaphore@1.0.0",
			"optionalDependencies": {},
			"engines": {
				"node": "*"
			},
			"_engineSupported": true,
			"_npmVersion": "1.1.16",
			"_nodeVersion": "v0.6.15",
			"_defaultsLoaded": true,
			"dist": {
				"shasum": "a9703f9334f4caf18d97c2874bde0f441bf7bca2",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.0.tgz"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				}
			],
			"directories": {},
			"contributors": []
		},
		"1.0.1": {
			"name": "semaphore",
			"version": "1.0.1",
			"description": "semaphore for node",
			"engine": "node >= 0.6.0",
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "1.0.x",
				"should": "0.6.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"_id": "semaphore@1.0.1",
			"dist": {
				"shasum": "74e3181df4cba653d20d5b0ab04a78efc2cf83ea",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.1.tgz"
			},
			"_npmVersion": "1.1.65",
			"_npmUser": {
				"name": "abrkn",
				"email": "a@abrkn.com"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				}
			],
			"directories": {},
			"contributors": []
		},
		"1.0.2": {
			"name": "semaphore",
			"version": "1.0.2",
			"description": "semaphore for node",
			"engine": "node >= 0.6.0",
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "1.0.x",
				"should": "0.6.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"repository": {
				"type": "git",
				"url": "git@github.com:abrkn/semaphore.js.git"
			},
			"scripts": {
				"test": "mocha"
			},
			"gitHead": "fe309c4ae083099675cc0013ca83808f347e8ed6",
			"bugs": {
				"url": "https://github.com/abrkn/semaphore.js/issues"
			},
			"_id": "semaphore@1.0.2",
			"_shasum": "5da5e45359acb5268818a3221665b3818e35c5c7",
			"_from": ".",
			"_npmVersion": "2.7.1",
			"_nodeVersion": "1.6.2",
			"_npmUser": {
				"name": "abrkn",
				"email": "a@abrkn.com"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				}
			],
			"dist": {
				"shasum": "5da5e45359acb5268818a3221665b3818e35c5c7",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.2.tgz"
			},
			"directories": {},
			"contributors": []
		},
		"1.0.3": {
			"name": "semaphore",
			"version": "1.0.3",
			"description": "semaphore for node",
			"engine": "node >= 0.6.0",
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "2.2.x",
				"should": "6.0.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"repository": {
				"type": "git",
				"url": "git@github.com:abrkn/semaphore.js.git"
			},
			"scripts": {
				"test": "mocha"
			},
			"gitHead": "a50de37da48aeafd580b8f283710cdca81d0bae1",
			"bugs": {
				"url": "https://github.com/abrkn/semaphore.js/issues"
			},
			"_id": "semaphore@1.0.3",
			"_shasum": "77dfc0180ebe7074b5176e7d64be5ef75d69736c",
			"_from": ".",
			"_npmVersion": "1.4.23",
			"_npmUser": {
				"name": "sqrt",
				"email": "sqrt@entless.org"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				},
				{
					"name": "sqrt",
					"email": "sqrt@entless.org"
				}
			],
			"dist": {
				"shasum": "77dfc0180ebe7074b5176e7d64be5ef75d69736c",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.3.tgz"
			},
			"directories": {},
			"contributors": []
		},
		"1.0.4": {
			"name": "semaphore",
			"version": "1.0.4",
			"description": "semaphore for node",
			"engines": {
				"node": ">=0.8.0"
			},
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "2.x.x",
				"should": "8.x.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"repository": {
				"type": "git",
				"url": "git+ssh://git@github.com/abrkn/semaphore.js.git"
			},
			"scripts": {
				"test": "mocha"
			},
			"gitHead": "bfcf35defab1e0f7040c16a08f0f7f1f32770214",
			"bugs": {
				"url": "https://github.com/abrkn/semaphore.js/issues"
			},
			"_id": "semaphore@1.0.4",
			"_shasum": "1f45e3075b2253d515a960a2a408360a39c267a8",
			"_from": ".",
			"_npmVersion": "2.14.7",
			"_nodeVersion": "4.2.2",
			"_npmUser": {
				"name": "abrkn",
				"email": "a@abrkn.com"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				},
				{
					"name": "sqrt",
					"email": "sqrt@entless.org"
				}
			],
			"dist": {
				"shasum": "1f45e3075b2253d515a960a2a408360a39c267a8",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.4.tgz"
			},
			"_npmOperationalInternal": {
				"host": "packages-6-west.internal.npmjs.com",
				"tmp": "tmp/semaphore-1.0.4.tgz_1455825800956_0.21430362574756145"
			},
			"directories": {},
			"contributors": []
		},
		"1.0.5": {
			"name": "semaphore",
			"version": "1.0.5",
			"description": "semaphore for node",
			"engines": {
				"node": ">=0.8.0"
			},
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "2.x.x",
				"should": "8.x.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"repository": {
				"type": "git",
				"url": "git+ssh://git@github.com/abrkn/semaphore.js.git"
			},
			"scripts": {
				"test": "mocha"
			},
			"gitHead": "4b7471c5efc348b3279621e58e0b47b55ac60040",
			"bugs": {
				"url": "https://github.com/abrkn/semaphore.js/issues"
			},
			"_id": "semaphore@1.0.5",
			"_shasum": "b492576e66af193db95d65e25ec53f5f19798d60",
			"_from": ".",
			"_npmVersion": "3.3.12",
			"_nodeVersion": "6.0.0-pre",
			"_npmUser": {
				"name": "sqrt",
				"email": "sqrt@entless.org"
			},
			"maintainers": [
				{
					"name": "abrkn",
					"email": "andreas@opuno.com"
				},
				{
					"name": "sqrt",
					"email": "sqrt@entless.org"
				}
			],
			"dist": {
				"shasum": "b492576e66af193db95d65e25ec53f5f19798d60",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.5.tgz"
			},
			"_npmOperationalInternal": {
				"host": "packages-9-west.internal.npmjs.com",
				"tmp": "tmp/semaphore-1.0.5.tgz_1456608578363_0.32074872963130474"
			},
			"directories": {},
			"contributors": []
		},
		"1.1.0": {
			"name": "semaphore",
			"version": "1.1.0",
			"description": "semaphore for node",
			"engines": {
				"node": ">=0.8.0"
			},
			"main": "./lib/semaphore.js",
			"dependencies": {},
			"devDependencies": {
				"mocha": "2.x.x",
				"should": "8.x.x"
			},
			"homepage": "https://github.com/abrkn/semaphore.js",
			"repository": {
				"type": "git",
				"url": "git+ssh://git@github.com/abrkn/semaphore.js.git"
			},
			"scripts": {
				"test": "mocha"
			},
			"gitHead": "88a33875b168cc7b5943d7fe987c36d08321d252",
			"bugs": {
				"url": "https://github.com/abrkn/semaphore.js/issues"
			},
			"_id": "semaphore@1.1.0",
			"_npmVersion": "5.3.0-canary.0",
			"_nodeVersion": "9.0.0-pre",
			"_npmUser": {
				"name": "addaleax",
				"email": "anna@addaleax.net"
			},
			"dist": {
				"integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==",
				"shasum": "aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa",
				"tarball": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz"
			},
			"maintainers": [
				{
					"email": "anna@addaleax.net",
					"name": "addaleax"
				},
				{
					"email": "a@abrkn.com",
					"name": "abrkn"
				}
			],
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/semaphore-1.1.0.tgz_1502209343262_0.5487388467881829"
			},
			"directories": {},
			"contributors": []
		}
	},
	"time": {
		"modified": "2018-01-31T10:24:28.180Z",
		"created": "2012-05-25T08:24:18.558Z",
		"1.0.0": "2012-05-25T08:24:21.263Z",
		"1.0.1": "2012-11-05T12:43:20.133Z",
		"1.0.2": "2015-04-01T07:58:29.412Z",
		"1.0.3": "2015-06-11T02:29:38.204Z",
		"1.0.4": "2016-02-18T20:03:23.362Z",
		"1.0.5": "2016-02-27T21:29:41.335Z",
		"1.1.0": "2017-08-08T16:22:24.146Z"
	},
	"users": {},
	"dist-tags": {
		"latest": "1.1.0"
	},
	"_uplinks": {
		"npmjs": {
			"etag": "W/\"da22ef7bcae40eff66b6c4da068a2964\"",
			"fetched": 1602009398961
		}
	},
	"_distfiles": {
		"semaphore-1.0.0.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.0.tgz",
			"sha": "a9703f9334f4caf18d97c2874bde0f441bf7bca2",
			"registry": "npmjs"
		},
		"semaphore-1.0.1.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.1.tgz",
			"sha": "74e3181df4cba653d20d5b0ab04a78efc2cf83ea",
			"registry": "npmjs"
		},
		"semaphore-1.0.2.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.2.tgz",
			"sha": "5da5e45359acb5268818a3221665b3818e35c5c7",
			"registry": "npmjs"
		},
		"semaphore-1.0.3.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.3.tgz",
			"sha": "77dfc0180ebe7074b5176e7d64be5ef75d69736c",
			"registry": "npmjs"
		},
		"semaphore-1.0.4.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.4.tgz",
			"sha": "1f45e3075b2253d515a960a2a408360a39c267a8",
			"registry": "npmjs"
		},
		"semaphore-1.0.5.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.0.5.tgz",
			"sha": "b492576e66af193db95d65e25ec53f5f19798d60",
			"registry": "npmjs"
		},
		"semaphore-1.1.0.tgz": {
			"url": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz",
			"sha": "aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa",
			"registry": "npmjs"
		}
	},
	"_attachments": {
		"semaphore-1.1.0.tgz": {
			"shasum": "aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa"
		}
	},
	"_rev": "22-67568e6e3e0e2de0",
	"_id": "semaphore",
	"readme": "semaphore.js\n============\n\n[![Build Status](https://travis-ci.org/abrkn/semaphore.js.svg?branch=master)](https://travis-ci.org/abrkn/semaphore.js)\n\nInstall:\nnpm install semaphore\n\nLimit simultaneous access to a resource.\n\n```javascript\n// Create\nvar sem = require('semaphore')(capacity);\n\n// Take\nsem.take(fn[, n=1])\nsem.take(n, fn)\n\n// Leave\nsem.leave([n])\n\n// Available\nsem.available([n])\n```\n\n\n```javascript\n// Limit concurrent db access\nvar sem = require('semaphore')(1);\nvar server = require('http').createServer(req, res) {\n\tsem.take(function() {\n\t\texpensive_database_operation(function(err, res) {\n\t\t\tsem.leave();\n\n\t\t\tif (err) return res.end(\"Error\");\n\n\t\t\treturn res.end(res);\n\t\t});\n\t});\n});\n```\n\n```javascript\n// 2 clients at a time\nvar sem = require('semaphore')(2);\nvar server = require('http').createServer(req, res) {\n\tres.write(\"Then good day, madam!\");\n\n\tsem.take(function() {\n\t\tres.end(\"We hope to see you soon for tea.\");\n\t\tsem.leave();\n\t});\n});\n```\n\n```javascript\n// Rate limit\nvar sem = require('semaphore')(10);\nvar server = require('http').createServer(req, res) {\n\tsem.take(function() {\n\t\tres.end(\".\");\n\t\t\n\t\tsetTimeout(sem.leave, 500)\n\t});\n});\n```\n\nLicense\n===\n\nMIT"
}