Code Monkey home page Code Monkey logo

norcal's Introduction

norcal

p2p command-line calendar

norcal screenshot

usage

norcal {PATTERN}

  Show events in month calendar format.
  By default, shows the current month,
  or you can specify a PATTERN:

  -3          Show the previous, current, and next month.
  YYYY        Show all the events in the year YYYY.
  YYYY-MM     Show all the events in the year/month YYYY-MM.
  MNAME       Show all the events for a month name MNAME in current year.
  MNAME YYYY  Show all the events for a month name MNAME in year YYYY.

norcal add TIMESTR {-t TITLE}

  Add an event by its TIMESTR with a TITLE.

norcal rm ID

  Delete an event by its ID.

norcal query {--gt GT --lt LT}

  List events from GT to LT.

api

var norcal = require('norcal')

var cal = norcal(opts)

Create a new norcal instance cal from:

  • opts.log - hyperlog instance to use
  • opts.db - leveldb instance to use

cal.add(time, opts, cb)

Add an event given by a free-form string time which is parsed by parse-messy-schedule. Optionally:

  • opts.created - parse relative to this time
  • opts.value - a value to store alongside the time

cb(err, node, id) fires with the underlying hyperlog node and the generated key/value id.

cal.remove(id, cb)

Remove an event by its id.

var stream = cal.query(opts, cb)

Produce a readable objectMode stream of events in the range given in opts:

  • opts.gt - date instance or string
  • opts.lt - date instance or string

Each document in the object stream:

  • doc.time - a Date instance for the event
  • doc.value - extra properties like a title
  • doc.created - when this record was created / relative to
  • doc.key - the id in the underlying key/value store

You can collect all of the documents with cb(err, docs).

install

To get the command-line tool:

npm install -g norcal

To get the library:

npm install norcal

license

BSD

norcal's People

Contributors

hackergrrl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.