npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@davidahouse/lincoln-api

v0.6.0

Published

An API for accessing Lincoln file contents

Downloads

23

Readme

@davidahouse/lincoln-api

npm (scoped) npm bundle size (minified)

API for accessing the Lincoln file storage

Install

$ npm install @davidahouse/lincoln-api

Usage

Configuring the API is easy, just specify the vault you want to interact with by name:

var LincolnVault = require('@davidahouse/lincoln-api')

var vault = new LincolnVault("yourvaultname")

Getting a list of all the vaults can be obtained using the allVaults method:

vault.allVaults(function (err,items) {
    // items is an array of the vault names
})

You can get the path to any of the Lincoln containers by using the pathFor method:

var path = vault.pathFor("Today")

The container names are as follows:

| Container | Description | |-----------|-------------| | Inbox | The inbox folder | | Today | The journal folder that points to today's date | | Journal/YYYY-MM-DD | The journal folder for a specific date | | Content/optional_folder_path | A content container. The folder path represents the folders under the main content root, but is optional | | | Any other path is assumed to be a virtual folder |

You can create a new markdown document using the newDocument method:

vault.newDocument("Glance", "My Document", "## The markdown contents go here")

Use the contents method to get a list of contents in a container:

vault.contents("Today", function(err, items) {
    // items contains an array of content file names
})

Importing files into Lincoln can be done with the importFile method:

vault.importFile("Inbox", "~/Desktop/everythingisfine.png")

You can also create a new file using the newFile method:

vault.newFile("Inbox", "mydoc.txt", "## The markdown contents go here")

The main difference between newFile and newDocument is that newFile lets you specify the full file name, whereas newDocument assumes you are creating a markdown document and provides the .md file extension for you.