103 lines
6.4 KiB
JSON
103 lines
6.4 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "netmask@^1.0.6",
|
|
"scope": null,
|
|
"escapedName": "netmask",
|
|
"name": "netmask",
|
|
"rawSpec": "^1.0.6",
|
|
"spec": ">=1.0.6 <2.0.0",
|
|
"type": "range"
|
|
},
|
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/pac-resolver"
|
|
]
|
|
],
|
|
"_from": "netmask@>=1.0.6 <2.0.0",
|
|
"_id": "netmask@1.0.6",
|
|
"_inCache": true,
|
|
"_location": "/netmask",
|
|
"_nodeVersion": "5.7.1",
|
|
"_npmOperationalInternal": {
|
|
"host": "packages-12-west.internal.npmjs.com",
|
|
"tmp": "tmp/netmask-1.0.6.tgz_1464621218193_0.5276697664521635"
|
|
},
|
|
"_npmUser": {
|
|
"name": "rs",
|
|
"email": "rs@dailymotion.com"
|
|
},
|
|
"_npmVersion": "3.6.0",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "netmask@^1.0.6",
|
|
"scope": null,
|
|
"escapedName": "netmask",
|
|
"name": "netmask",
|
|
"rawSpec": "^1.0.6",
|
|
"spec": ">=1.0.6 <2.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/pac-resolver"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz",
|
|
"_shasum": "20297e89d86f6f6400f250d9f4f6b4c1945fcd35",
|
|
"_shrinkwrap": null,
|
|
"_spec": "netmask@^1.0.6",
|
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/pac-resolver",
|
|
"author": {
|
|
"name": "Olivier Poitrey",
|
|
"email": "rs@dailymotion.com"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/rs/node-netmask/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "Parse and lookup IP network blocks",
|
|
"devDependencies": {
|
|
"coffee-script": ">=1.2.0",
|
|
"vows": "*"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "20297e89d86f6f6400f250d9f4f6b4c1945fcd35",
|
|
"tarball": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz"
|
|
},
|
|
"engines": {
|
|
"node": ">= 0.4.0"
|
|
},
|
|
"gitHead": "610161f7a8caf2e3004c03bb6ec8931c37b957c6",
|
|
"homepage": "https://github.com/rs/node-netmask",
|
|
"keywords": [
|
|
"net",
|
|
"mask",
|
|
"ip",
|
|
"network",
|
|
"cidr",
|
|
"netmask",
|
|
"subnet",
|
|
"ipcalc"
|
|
],
|
|
"license": "MIT",
|
|
"main": "./lib/netmask",
|
|
"maintainers": [
|
|
{
|
|
"name": "rs",
|
|
"email": "rs@dailymotion.com"
|
|
}
|
|
],
|
|
"name": "netmask",
|
|
"optionalDependencies": {},
|
|
"readme": "Netmask\n=======\n\nThe Netmask class parses and understands IPv4 CIDR blocks so they can be explored and compared. This module is highly inspired by Perl [Net::Netmask](http://search.cpan.org/dist/Net-Netmask/) module.\n\nSynopsis\n--------\n\n var Netmask = require('netmask').Netmask\n\n var block = new Netmask('10.0.0.0/12');\n block.base; // 10.0.0.0\n block.mask; // 255.240.0.0\n block.bitmask; // 12\n block.hostmask; // 0.15.255.255\n block.broadcast; // 10.15.255.255\n block.size; // 1048576\n block.first; // 10.0.0.1\n block.last; // 10.15.255.254\n\n block.contains('10.0.8.10'); // true\n block.contains('10.8.0.10'); // true\n block.contains('192.168.1.20'); // false\n\n block.forEach(function(ip, long, index));\n\n block.next() // Netmask('10.16.0.0/12')\n\nConstructing\n------------\n\nNetmask objects are created with an IP address and optionally a mask. There are many forms that are recognized:\n\n '216.240.32.0/24' // The preferred form.\n '216.240.32.0/255.255.255.0'\n '216.240.32.0', '255.255.255.0'\n '216.240.32.0', 0xffffff00\n '216.240.32.4' // A /32 block.\n '216.240.32' // A /24 block.\n '216.240' // A /16 block.\n '140' // A /8 block.\n '216.240.32/24'\n '216.240/16'\n\nAPI\n---\n\n- `.base`: The base address of the network block as a string (eg: 216.240.32.0). Base does not give an indication of the size of the network block.\n- `.mask`: The netmask as a string (eg: 255.255.255.0).\n- `.hostmask`: The host mask which is the opposite of the netmask (eg: 0.0.0.255).\n- `.bitmask`: The netmask as a number of bits in the network portion of the address for this block (eg: 24).\n- `.size`: The number of IP addresses in a block (eg: 256).\n- `.broadcast`: The blocks broadcast address (eg: 192.168.1.0/24 => 192.168.1.255)\n- `.first`, `.last`: First and last useable address\n- `.contains(ip or block)`: Returns a true if the IP number `ip` is part of the network. That is, a true value is returned if `ip` is between `base` and `broadcast`. If a Netmask object or a block is given, it returns true only of the given block fits inside the network.\n- `.forEach(fn)`: Similar to the Array prototype method. It loops through all the useable addresses, ie between `first` and `last`.\n- `.next(count)`: Without a `count`, return the next block of the same size after the current one. With a count, return the Nth block after the current one. A count of -1 returns the previous block. Undef will be returned if out of legal address space.\n- `.toString()`: The netmask in base/bitmask format (e.g., '216.240.32.0/24')\n\nInstallation\n------------\n\n $ npm install netmask\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2011 Olivier Poitrey <rs@dailymotion.com>\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n\n\n\n",
|
|
"readmeFilename": "README.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git://github.com/rs/node-netmask.git"
|
|
},
|
|
"scripts": {
|
|
"prepublish": "coffee -c lib/*.coffee",
|
|
"test": "vows --spec test/*"
|
|
},
|
|
"version": "1.0.6"
|
|
}
|