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

radic

v0.7.0

Published

Usefull general modules. Cli helper/tools, file based DB with models, validation, schemas. Utility functions. Downloader. Virtualbox vm vboxmanage. Inline shell bash scripts.

Downloads

56

Readme

radic

Travis build status NPM Version NPM Downloads Goto documentation Goto repository License

Overview

radic is the core library and application for many of my node applications.

  • It exports a variety of objects, classes and instances for external use.

  • radic is also a stand-alone application which manages global configuration and such.

How to use

Documentation

Installation

# Globally install radic for using radic command line tools
sudo npm install -g radic

# Local install into project for using libraries and helpers
npm install --save radic

Overview

| Module | Description | |:-------|:------------| | config | persitent file based configuration | | db | file based database. Uses models/schemas with validation | | git | local commands like add, commit etc. also includes API for github/bitbucket | | util | extends the core util functionality with extras | | ui | .. | | cli | cli commands, output, input etc | | net | network functionality, like downloading | | sh | shell exec, execsync, execlist etc | | binwraps | wraps cli commands in a nice coat. | | google | google api functions |

Basic usage

Config
var radic = require('radic'),
    Config = radic.Config,
    config = new Config('config', { /** options */ });
    
var abc = config.get('a.b.c'); 
config.set('a.b', 'c'); 
config.set('a', { b: 'c' }, true); // saves the modified configuration to file
config.del('a.b');
config.clear();
config.save(); // or this
Cli
#!/usr/bin/env node
var radic = require('radic'),
    cli = radic.cli;

cli.command('version OR version :type')
    .description('Shows current version')
    .usage('radic version minor', 'shows version')
    .method(function (cmd) {
        cli.log.info(cli.red.bold('1.0.0'));
    });
    
cli.parse(process.argv);
SH
var radic = require('radic');
var result;

// Synchronous exec
result = radic.sh.execSync('apt-cache search mono | grep develop');
console.log(result.code); console.log(result.stdout);

// Inline scripts

result = radic.sh.inlineScript('echo "hai"\n\
echo "bai" \n\
echo "draai"');
console.log(result.code);
console.log(result.stdout);

result = radic.sh.inlineScript(function(){/*
       echo "hai"
       echo "bai"
       echo "draai"
       #apt-cache search mono
*/});
console.log(result.code);
console.log(result.stdout);
Net
var radic = require('radic');
radic.net.download('http://download.gigabyte.ru/driver/mb_driver_marvell_bootdisk_w7w8.exe', __dirname, { /* options */ }, function(){
    // optional callback to make function execute asynchronously
});
Binwraps
var radic = require('radic');    
var binwraps = radic.binwraps;

binwraps.createBinWrap('VBoxManage');
     
var vbox = binwraps.vboxmanage;
var result = vbox('createvm', {
  name: ops.name,
  ostype: 'Debian_64',
  basefolder: path.resolve(process.cwd()),
  register: true
});
console.log(result.stdout, result.code);


binwraps.autoSyncExec = false;
vbox('createvm', {
  name: ops.name,
  ostype: 'Debian_64',
  basefolder: path.resolve(process.cwd()),
  register: true
}, function(){
     // callllback
});


var commands = binwraps.getCommands();
binwraps[ commands[0] ]('arg', { weed: 'bad' }); // just an example..
DB

File based database

var db = new require('radic').DB('myfileDB4', {
    path: 'HOMEDIR/.radic/stores',
    ext: '.db',
    onLoaded: function(){}
});

var user = db.model('user', {
    type: 'object',
    properties: {
        username: { type: 'string', eq: 'ipsum' },
        email: { type: 'string', eq: 'ipsum' },
        password: {
            type: 'array',
            items: { type: 'number' }
        }
    }
});

License

Copyright 2014 Robin Radic

MIT Licensed