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

simple-installer-tool

v1.0.0

Published

Download and/or install programs in similar manner to chocolatey or similar installation managers.

Downloads

15

Readme

Simple installer

Gitter
Download and/or install programs in similar manner to chocolatey or similar installation managers.

  • crossplatform (tested on windows and debian)
  • downloads files (optional) and runs commands
  • skips already installed programs
  • could be used as a simple task runner
  • could work as a downloader
  • simple and because of that flexible and expendable api
  • tested with 100% coverage
  • uses harmony mode for generators and npm co to manage execution flow

License

  • http://unlicense.org/

Tests:

To launch tests you have to run npm install then npm test or if you prefer grunt test.

If you want to contribute make sure to run grunt githooks first thing after clone. It will create pre-commit hook and run tests and jshint before you commit. Please use git flow - create a feature branch for your feature and send a pull request to dev.

API:

SimpleInstaller exports a constructor, which takes and object with following properties:

  • link :string - (optional) url to installer/executable or any other resource
  • name :string - used for progress reporting and for installation process, see installProgram for details
  • prefix :string - (optional) used for installation process, prepends part of command to name, see installProgram for details
  • postfix :string - (optional) used for installation process, appends part of command to name, see installProgram for details
  • update :generator function - (optional) if program is already installed it runs user code for an update
  • tempFolder :string - (optional) overwrites SimpleInstaller.tempFolder
  • installMessage :string - (optional) used for progress reporting, overwrites default string 'installing ' + info.name

Constructor has following static properties:

  • tempFolder :string - defaults to "temp", all downloads will be placed here

Constructor has following prototype methods:

  • run :generator function - first it runs isInstalled, if result is successful it runs chooseInstallProcess, otherwise it runs runUpdateIfExists
  • isInstalled :function - uses crossplatform version of which verifying that info.name exists in your path
  • runUpdateIfExists :generator function - if info.update exists, it will run it. this is referring to info object
  • chooseInstallProcess :generator function - if info.link wasn't specified it runs installProgram, else it runs downloadAndInstall
  • downloadAndInstall :generator function - downloads info.link and runs installProgram
  • installProgram :function - concatenates info.prefix, info.name and info.postfix and runs results as a command line

Examples:

//following will install git on windows using git.inf if git.exe doesn't exist in your path
var co = require('co');
var SimpleInstaller = require('simple-installer');

co(function* () {
    yield new SimpleInstaller({
        link: 'http://github.com/msysgit/msysgit/releases/download/' +
        'Git-1.9.4-preview20140929/Git-1.9.4-preview20140929.exe',
        name: 'git.exe',
        postfix: ' /DIR="c:\\Git" /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /NOICONS ' +
        '/COMPONENTS="icons,ext\\reg\\shellhere,assoc,assoc_sh" /LOADINF="git.inf"'
    }).run();
});

//same example for debian
var co = require('co');
var SimpleInstaller = require('simple-installer');

co(function* () {
    yield new SimpleInstaller({
        prefix: 'apt-get install ',
        name: 'git'
    }).run();
});

For advanced usage (batch install, update, ...) check example folder.

Analytics