🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

vdata-parser

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vdata-parser

Parse vdata (ics, vcal, vcard) to javscript objects.

latest
npmnpm
Version
0.1.5
Version published
Weekly downloads
6.4K
31.69%
Maintainers
1
Weekly downloads
 
Created
Source

vdata-parser Build Status

Parse vdata (ics, vcal, vcard) to javscript objects.

Getting Started

Install the module with: npm install vdata-parser

var parser = require('vdata-parser');

Documentation

fromString(string)

Parse a string and return a object which contains the data which parsed.

Return: Object - The parsed data

string

  • Type: String

The string contains the vdata which should be parsed.

fromFile(filename, callback)

Parse the file and execute the given callback.

filename

  • Type: String

The file which should be parsed.

callback

  • Type: Function

The function which is called if file is successful finished or an error was occurred. The callback is called with two arguments: err and data. The argument err is null and data is an object if no error is occurred.

fromFileSync(filename)

Parse a file synchronic.

Return: Object - The parsed data

filename

  • Type: String

The file which should be parsed.

Examples

Parse a string

var parser = require('vdata-parser');

// ... define variable `string` ...

var data = parser.fromString(string);

console.dir(data);

Parse a file asynchrone

var parser = require('vdata-parser');

parser.fromFile(__dirname + '/file', function (err, data) {
        if (err) throw err;

        console.dir(data);
    });

Parse a file synchron

var parser = require('vdata-parser');

var data = parser.fromFileSync(__dirname + '/file');

console.dir(data);

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 Florian Goße. Licensed under the MIT license.

Keywords

vdata

FAQs

Package last updated on 28 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts