This package has been deprecated

Author message:

this package is no longer on npm

licuri

1.0.2 • Public • Published

Licuri

Licuri palm seeds

Compliant data:uri parser

Uses an actual grammar (PEG.js syntax) derived from the RFC instead of simple string operations and/or regex matching. Handles base64 and plain text, supports content-type parameters. No runtime dependencies.

Install

$ npm install --save licuri

Build

$ git clone git://github.com/passcod/licuri
$ cd licuri
$ npm run build

Use

var licuri = require('licuri');

var uri = licuri.parse('data:,foobar');
console.log(uri.data); //=> "foobar"

Returned object synopsis

{
  "raw": "Raw data as given in the uri",
  "data": "Decoded data, either from base64 or URL-encoding",
  "base64": false, "(bool": "Whether the data was base64-encoded)",
  "content": {
    "type": "Default: text",
    "subtype": "Default: plain",
    "params": {
      "Any": "parameter",
      "attached": "to",
      "the": "content-type"
    }
  }
}

Community

  • Released in the Public Domain
  • PRs and issue/bug reports welcome

Readme

Keywords

Package Sidebar

Install

npm i licuri

Weekly Downloads

1

Version

1.0.2

License

none

Last publish

Collaborators

  • passcod