{"_id":"parsifal","_rev":"269049","name":"parsifal","description":"A pure JavaScript port of jQuery's .val() method.","dist-tags":{"latest":"0.0.0"},"maintainers":[{"name":"3rdeden","email":""},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":""},{"name":"v1","email":""}],"time":{"modified":"2023-06-28T12:13:43.000Z","created":"2014-04-22T09:50:55.933Z","0.0.0":"2014-04-22T09:50:55.933Z"},"users":{},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"git://github.com/bigpipe/parsifal.git"},"versions":{"0.0.0":{"name":"parsifal","version":"0.0.0","description":"A pure JavaScript port of jQuery's .val() method.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bigpipe/parsifal.git"},"keywords":["jquery","val","value","input","select","dropdown","checkbox","radio","keygen","button"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/bigpipe/parsifal/issues"},"homepage":"https://github.com/bigpipe/parsifal","_id":"parsifal@0.0.0","dist":{"shasum":"852218c18bfe94a3725ff219e6dacb8c8923202f","size":2879,"noattachment":false,"key":"/parsifal/-/parsifal-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/parsifal/download/parsifal-0.0.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":""},{"name":"v1","email":""}],"directories":{},"_cnpmcore_publish_time":"2021-12-19T13:24:43.913Z","publish_time":1398160255933,"_cnpm_publish_time":1398160255933}},"readme":"# Parsifal\n\nParsifal is a pure JavaScript port of jQuery's `.val()` method which is used to\nretrieve values from from elements.\n\n## Installation\n\nThe package can be used through browserify as the module contents are exposes\nthrough the `module.exports` interface. Therefor this package is installable\nusing npm:\n\n```\nnpm install --save parsifal\n```\n\n## Usage\n\nThis module exposes the parser as a single function. To use it in your library\nsimple require the module:\n\n```js\n'use strict';\n\nvar val = require('parsifal');\n```\n\nNow that we have access to the method, we can simply start parsing the value's\nout of elements:\n\n```js\nvar value = val(document.getElementByTagName('input')[0]);\n```\n\nAnd that's it. Super simple, super effective.\n\n### parsifal.parser\n\nWe expose dedicated parsers for elements based on their `type` or `nodeName`. If\nyou wish to add more or change a parser simply add or override the property\nwith a new method. Check the source for the current dedicated parsers.\n\n```js\n//\n// EXAMPLE: Simple override or introduction of the radio button parser so it\n// returns booleans instead of strings.\n//\nparsifal.parser.radio = function radio(element) {\n  return ((element.getAttribute('value') !== null ? element.value : 'on') === 'on';\n};\n```\n\n---\n\nThe following methods are mostly internally but are to useful for other to not\nexpose them.\n\n### parsifal.trim()\n\n```js\nparsifal.trim(string)\n```\n\nTrim the whitespace of a string from the right and left side.\n\n```js\nvar str = parsifal.trim('  fooo   ');\n// str is now 'foo'\n```\n\n### parsifal.text()\n\n```js\nparsifal.text(element)\n```\n\nGet the text from a given element without all the nasty HTML.\n\n```js\nvar text = parsifal.text(document.getElementById('example'));\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/bigpipe/parsifal","bugs":{"url":"https://github.com/bigpipe/parsifal/issues"},"license":"MIT"}