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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nodepptp

v1.0.2

Published

PPTP Management library for Node

Downloads

6

Readme

nodepptp

Manage users, sessions and settings of pptpd on linux.

This library is not designed to help you get a working pptpd setup and running, it assumes you have already done this - see the many many guides related to setting up pptpd on the interwebs - I like this one

Tested on:

  • Centos 6.4
  • Centos 6.5
  • Centos 7

Usage

Load pptp library

var pptp = require('./nodepptp');

PPTPD Settings

/**
 * Display the PPTPD settings from the file set in config.json
 * @param  Array settings array
 */
pptp.settings.pptpd.load(function (settings) {
    console.log(settings); // output of all settings
});

/**
 * Save PPTPD settings to file specified in config.json
 * @param  Array settings to save
 * @param  Boolean result of method
 */
pptp.settings.pptpd.save(['setting 1', 'setting 2', 'setting 3'], function (result) {
    console.log(result); // true or false if file was written
});

PPTPD Options

/**
 * Load the options from the file specified in the config.json
 * @param  Array options array returned from the file
 */
pptp.settings.options.load(function (options) {
    console.log(options); // output of all options
});

/**
 * Save the options to the file specified in the config.json
 * @param  Array options to write to the file
 * @param  Boolean result of write action
 */
pptp.settings.options.save(['option 1', 'option 2', 'option 3'], function (result) {
    console.log(result); // true or false if file was written
});

Sessions

/**
 * List the active sessions
 * @param  Array list of active sessions
 */
pptp.sessions.active(function (sessions) {
    console.log(sessions); // list the active sessions
    /*
    [ { 
        user: 'bob',
        interface: { 
            device: 'ppp0',
            localip: '10.1.1.51',
            assignedip: '10.1.1.100',
            rx: { packets: '34', bytes: '2164' },
            tx: { packets: '7', bytes: '94' } 
        },
        clientip: '10.1.1.53',
        connected: Sat Sep 20 2014 15:40:14 GMT+1200 (NZST),
        disconnected: null 
    } ]        
     */
});

/**
 * List the inactive sessions
 * @param  Array list of inactive sessions
 */
pptp.sessions.inactive(function (sessions) {
    console.log(sessions); // list the inactive sessions
    /*
    [ { 
        user: 'bob',
        interface: { device: 'ppp0' },
        clientip: '10.1.1.53',
        connected: Sat Sep 20 2014 15:40:14 GMT+1200 (NZST),
        disconnected: Sat Sep 20 2014 15:57:33 GMT+1200 (NZST) 
    } ]
     */
});

/**
 * Kill a user's session
 * @param  String assigned ip address of the session to kill
 * @param  Boolean result of kill action
 */
pptp.sessions.kill('10.1.1.100', function (result) {
    console.log(result); // true if user's session was terminated
});

Users

/**
 * Add a user
 * @param  String name of the user
 * @param  String server name
 * @param  String password for the user
 * @param  String allowed IP Address
 */
pptp.users.add('jim', '*', 'password', '*', function (result) {
    console.log(result); // true or false if user was added
});

/**
 * Remove a user
 * @param  String name of the user
 */
pptp.users.add('jim', function (result) {
    console.log(result); // true or false if user was removed
});

/**
 * List all users in the users file specified in config.json
 * @param  Array list of users
 */
pptp.users.all(function (users) {
    console.log(users);
});

Troubleshooting

  • Verify the paths in config.json are correct - they should be for a default environment, however if your's is weird, these will need to change.
  • Verify that you have last and your pptpd.conf has the flag logwtemp
  • If you don't get any interfaces for connected sessions, you may need to modify lib/ifconfig.js it just uses regex to match ifconfig and pull data relating to the ppp interfaces.