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

wolkjsclient

v1.0.0

Published

A simple JavaScript client to connect with the Wolk notebook instance.

Downloads

4

Readme

Wolk JavaScript client

A client, written in JavaScript, to connect to an online Wolk instance and execute the API calls. Wolk (Dutch for "cloud") is an online notebook with a very simple RESTful API.

Installation

npm install wolkjsclient

Examples

Connecting to the client

var wolk = new wolkClass("https://wolkjs.com/", "username", "password");

Checking the user credentials

wolk.checkUser("username", function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Requesting a note

The first parameter is the note ID.

wolk.getNote(30, function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Querying all notes

The third parameter is whether to include the note content, the fourth parameter the search term, the fifth parameter the cap (how many notes to load), the sixth parameter the page (if a cap is set) and the seventh parameter which notes to retrieve. These 5 parameters are optional.

wolk.getNotes(function(data){
  console.log(data);
}, function(err){
  console.log(err);
}, false, null, 3, 2, wolk.noteRetrieveType.RetrieveAll);

wolk.noteRetrieveType values

  • wolk.noteRetrieveType.RetrieveAll: get all notes
  • wolk.noteRetrieveType.RetrieveArchived: get only archived notes
  • wolk.noteRetrieveType.RetrieveNonArchived: get only non archived notes

Adding a note

The first parameter is the title and the second parameter is the note content.

wolk.addNote("#duco #test 123", "# This is a test", function(data){
  console.log(data);
}, function(err){
  console.log(err)
});

Updating a note

The first parameter is the note ID, the second parameter is the title and the third parameter is the note content.

wolk.updateNote(30, "#duco #test 1231123", "# This is still a test", function(data){
  console.log(data);
}, function(err){
  console.log(err)
});

Deleting a note

The first parameter is the note ID.

wolk.deleteNote(30, function(data){
  console.log(data);
}, function(err){
  console.log(err)
});

Archiving a note

The first parameter is the note ID.

wolk.archiveNote(3, function(data){
  console.log(data);
}, function(err){
  console.log(err)
});

Requesting the tags

wolk.getTags(function(data){
  console.log(data);
}, function(err){
  console.log(err)
});

Downloading a file

The first parameter is the unique code of the file and the second parameter the location where the file should be saved.

wolk.getFile("d9b791fa-39dc-4b5e-96cb-08f54028402a", "/home/user/image.png", function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Requesting files of a specific note

This method returns all file meta data (so no file contents) of all files from a specific note.

wolk.getFiles(3, function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Requesting all files

This method returns all file meta data (so no file contents).

wolk.getAllFiles(function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Adding a file

The first parameter is the note ID and the second parameter is the path to the file you want to upload.

wolk.addFile(3, "/home/user/Pictures/Screenshot from 2015-11-04 23:55:28.png", function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Deleting a file

The first parameter is the file ID.

wolk.deleteFile(9, function(data){
  console.log(data);
}, function(err){
  console.log(err);
});

Requesting metadata

This method returns all metadata of the application.

wolk.getMetadata(function(data){
  console.log(data);
}, function(err){
  console.log(err);
});