Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Node.js module for the Yourls API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
Octocat-spinner-32 yourls.js
README.md

node-yourls - Yourls API for nodejs

This module provides hooks into the Yourls API for Nodejs. For more information about Yourls and what it can do, visit their API docs.

Note

YOURLS is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL). You can make it private or public, you can pick custom keyword URLs. This means you will need the URL of your, or someone else's, YOURLS installation as well as an API Signature token for that install.

Installation

Using NPM, npm install yourls

Using git, git clone https://github.com/gabrielpreston/node-yourls.git /path/to/yourls

Usage

var Yourls = require('./node-yourls/yourls');

var yourls_url = 'ph.ly';
var yourls_api = '1a40d1e654';

var yourls = new Yourls(yourls_url, yourls_api);

yourls.shorten('https://github.com/gabrielpreston/node-yourls', function(error, result) {
    if (error) {
        throw error;
    }
    console.log(result);
});

Tests

To run tests type npm test

Yourls Features

  • shorten
  • vanity
  • expand
  • urlstats
Something went wrong with that request. Please try again.