Dayone
NodeJS Module to create, list and remove Day One Journal entries
Install / Use
/learn @pwaldhauer/DayoneREADME
dayone
NodeJS Module to create, list and remove Day One Journal entries, without using the Day One command line tools.
Usage
var DayOne = require('dayone').DayOne;
var DayOneEntry = require('dayone').DayOneEntry;
// Basic entry
var entry = new DayOneEntry();
entry.creationDate = new Date();
entry.text = 'Very thoughtful entry!';
entry.tags = ['Test'];
// Attach a photo!
var entryWithPhoto = new DayOneEntry();
entryWithPhoto.text = 'Have a photo!';
entryWithPhoto.photo = new Buffer(fs.readFileSync('photo.jpg'));
var dayone = new DayOne();
dayone.save(entry, function(error) {
console.log('Saved!');
})
Optionally DayOne() accepts an object containing a directory that should point to the Day One Journal directory. If omitted it will use the iCloud documents directory by default. If it doesn't find the iCloud directory, it will use the Dropbox Application directory.
For more usage examples take a look at the tests or Elizabeth, my script to export your Moves.app data, which uses this module. Surprise!
Methods
DayOne#list(options, cb)
Lists all entries in the journal. List may be filtered by tags by passing in {"tags": ["Tags", "to", "filter", "by"]} as options. The callback should be a function(err, entries) {}.
DayOne#save(entry, cb)
Saves the given DayOneEntry. The callback should be a function(err) {}.
DayOne#remove(uuid, cb)
Removes the entry. The callback should be a function(err) {}.
DayOneEntry
Basically an object with the following fields: creationDate (Date), text (String), tags (Array), timezone (String), starred (Bool), UUID (String), photo (Buffer). If the UUID is not defined it will be automatically created.
Contribute
Feel free to contribute! :)
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
