This repository has been archived on 2022-07-06. You can view files and clone it, but cannot push or open issues or pull requests.
websocket-webcam/node_modules/jsftp/node_modules/parse-listing/package.json

56 lines
4.8 KiB
JSON

{
"name": "parse-listing",
"id": "parse-listing",
"version": "1.0.1",
"description": "Small library to parse file listings into JavaScript objects",
"keywords": [
"parse",
"ls",
"list",
"listing",
"ftp",
"unix",
"dos"
],
"author": {
"name": "Sergi Mansilla",
"email": "sergi.mansilla@gmail.com",
"url": "http://sergimansilla.com"
},
"homepage": "https://github.com/sergi/parse-listing",
"repository": {
"type": "git",
"url": "https://github.com/sergi/parse-listing.git"
},
"bugs": {
"url": "https://github.com/sergi/parse-listing/issues"
},
"dependencies": {
"async": "~0.2.9"
},
"devDependencies": {
"mocha": "~1.10.0",
"istanbul": "~0.1.36",
"mocha-istanbul": "~0.2.0"
},
"main": "src/parser.js",
"engines": {
"node": ">=0.6.21"
},
"scripts": {
"test": "mocha -R spec -t 5000"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/sergi/parse-listing/blob/master/LICENSE"
}
],
"readme": "## parse-listing [![Build Status](https://secure.travis-ci.org/sergi/parse-listing.png)](http://travis-ci.org/sergi/parse-listing)\n\nSimple library that parses file listing input for different platforms. An\nexample file listing is the output of the `ls` command in unix, or the `dir`\ncommand in DOS/Windows platforms.\n\n## Example\n\n```javascript\nvar Parser = require(\"parse-listing\");\n\n// Yeah yeah, multiline strings would make Crockford mad, I know.\nvar str = \"drwxr-xr-x 5 1001 1001 4096 Jan 09 11:52 .\\r\\n\\\ndrwxr-xr-x 4 0 0 4096 Sep 19 13:50 ..\\r\\n\\\n-rw------- 1 1001 1001 1118 Jan 09 12:09 .bash_history\\r\\n\\\n-rw------- 1 1001 1001 943 Jan 09 11:52 .viminfo\\r\\n\\\ndrwxrwxr-x 5 1001 1001 4096 Jan 09 11:52 inaccessible\\r\\n\\\ndrwxrwxrwx 2 1001 1001 4096 Sep 21 11:20 project1\\r\\n\\\ndrwx------ 2 1001 1001 4096 Oct 19 16:17 project2\\r\\n\";\n\nParser.parseEntries(str, function(err, entryArray) {\n entryArray.forEach(function(entry, i) {\n console.log(\"Name:\",entry.name);\n console.log(\"Type\", entry.type);\n console.log(\"Size:\", entry.size);\n });\n});\n```\n\nThe example above will print the name, type and size for every entry in the\nlisting. A parsed line becomes a JavaScript object like this:\n\n```javascript\n {\n type: 1,\n size: 4096,\n name: \"project2\",\n time: 1382192220000,\n owner: \"1001\",\n group: \"1001\",\n\n userPermissions: {\n read: true,\n write: true,\n exec: true\n },\n\n groupPermissions: {\n read: false,\n write: false,\n exec: false\n },\n\n otherPermissions: {\n read: false,\n write: false,\n exec: false\n }\n }\n```\n\n## Methods\n\n### parseEntries(string | array, callback)\n\nAsynchronously parses a list of entries either in a single string (entries will\nbe split by newlines) or in an array of strings. Invokes the callback when all\nthe entries have been processed, and passes an array of JavaScript objects.\n\n### parseEntry(string)\n\nParses a single string such as:\n\n`drwxrwxrwx 2 1001 1001 4096 Sep 21 11:20 project`\n\nand returns the JavaScript object for it. There is no need to specify whether the\nentry is in UNIX or MS-DOS/Windows format. The parser will find out by itself.\n\n## Installation\n\nWith NPM:\n\n npm install parse-listing\n\nFrom GitHub:\n\n git clone https://github.com/sergi/parse-listing.git\n\n## License\n\nThe MIT License\n\nCopyright(c) 2013 Sergi Mansilla <sergi.mansilla AT gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n\n\n",
"_id": "parse-listing@1.0.1",
"dist": {
"shasum": "3c24c2694ad07dd88959cc1d4d8c4b77699113c8"
},
"_from": "parse-listing@~1.0.0"
}