Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgibbons committed Feb 9, 2018
1 parent 45960f0 commit a04b32f
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ ics.createEvent({
})
```

3. Write multiple iCalendar files:
3. Create multiple iCalendar files:
```javascript
import ics from 'ics'

`ics.createEvents` functionality is on the roadmap, but in the meanwhile, you can do this easily
by following [this example](https://github.com/adamgibbons/ics/wiki/Creating-multiple-events).
ics.createEvents()

```

## API

### `createEvent(attributes, [callback])`
### `createEvent(attributes[, callback])`

Returns an iCal-compliant text string.
If callback is provided, returns a Node-style callback.
Expand Down Expand Up @@ -144,6 +147,20 @@ function (err, value) {
}
```

### `createEvents(events[, callback])`

#### `events`

Array of `attributes` objects (as described in `createEvent`).

Returns an object iCal-compliant text string.

If callback is not provided, returns an array of objects, each having the form `{ error, value }`.
If `value` exists, it is an iCal-compliant text string.

If callback is provided, returns a Node-style callback, where the first argument is an error, and the second
is an array of objects, each having the form `{ error, value }`.

## Develop

Run mocha tests and watch for changes:
Expand Down

0 comments on commit a04b32f

Please sign in to comment.