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

grunt-redis-winserver

v0.3.0

Published

A grunt plugin for installing, running and controlling a redis server on windows.

Downloads

2

Readme

grunt-redis-winserver

A grunt plugin for installing, running and controlling a redis server on windows.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-redis-winserver --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-redis-winserver');

The "redis_server" task

Overview

In your project's Gruntfile, add a section named redis_server to the data object passed into grunt.initConfig().

grunt.initConfig({
  redis_server: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Calling the task

When calling the task, you need to define what action you with to take with the redis server. These are used as arguments when calling the task target, as redis_server:your_target:action, where your_target is the name of your target and action is any one of the below:

  • install: this will install redis as a windows service
  • start: this will start the service. If service is not installed, a install command will be issued first.
  • stop: this will stop the service.
  • uninstall: this will uninstall the service. If service is running, a stop command will be issued first.
  • status: this will log service state (NOT INSTALLED, STOPPED, RUNNING) to console output.
  • run: Instead of installing the service, you can also run the redis service from grunt. This will lock the console to this command, and you must ctrl + C to exit the process.

You cannot call more than one action this way, but you can call this task several times in a row by setting up an alias task.

Options

options.name

Type: String Default value: 'grunt-redis'

The name of the windows service. Will show up on services.msc on the computer.

options.start_retry_count

Type: Integer Default value: 3

Specify the maximum number of automatic tries to start the service.

options.redisconf

Type: [Object]

This objects contains all redis configuration data. A current bug with redis on windows makes redis.conf-files unavailable, so all configuration options must be defined here. The available commands and their format is as follows:

redisconf: {
	'daemonize':                     '[yes/no]',
	'pidfile':                       '[file]',
	'port':                          '[port number]',
	'tcp-backlog':                   '[number]',
	'bind':                          '[address] [address] ...',
	'unixsocket':                    '[path]',
	'timeout':                       '[value]',
	'tcp-keepalive':                 '[value]',
	'loglevel':                      '[value]',
	'logfile':                       '[file]',
	'syslog-enabled':                '[yes/no]',
	'syslog-ident':                  '[string]',
	'syslog-facility':               '[string]',
	'databases':                     '[number]',
	'save':                          '[seconds] [changes] or ""',
	'stop-writes-on-bgsave-error':   '[yes/no]',
	'rdbcompression':                '[yes/no]',
	'rdbchecksum':                   '[yes/no]',
	'dbfilename':                    '[filename]',
	'dir':                           '[path]',
	'slaveof':                       '[master port]',
	'masterauth':                    '[master-password]',
	'slave-serve-stale-data':        '[yes/no]',
	'slave-read-only':               '[yes/no]',
	'repl-ping-slave-period':        '[number]',
	'repl-timeout':                  '[number]',
	'repl-disable-tcp-nodelay':      '[yes/no]',
	'repl-backlog-size':             '[number]',
	'repl-backlog-ttl':              '[number]',
	'slave-priority':                '[number]',
	'min-slaves-to-write':           '[number]',
	'min-slaves-max-lag':            '[number]',
	'requirepass':                   '[string]',
	'rename-command':                '[string]',
	'maxclients':                    '[number]',
	'maxmemory':                     '[bytes]',
	'maxmemory-policy':              '[policy]',
	'maxmemory-samples':             '[number]',
	'appendonly':                    '[yes/no]',
	'appendfilename':                '[value]',
	'appendfsync':                   '[value]',
	'no-appendfsync-on-rewrite':     '[value]',
	'auto-aof-rewrite-percentage':   '[number]',
	'auto-aof-rewrite-min-size':     '[number]',
	'lua-time-limit':                '[number]',
	'slowlog-log-slower-than':       '[number]',
	'slowlog-max-len':               '[number]',
	'notify-keyspace-events':        '[string]',
	'hash-max-ziplist-entries':      '[number]',
	'hash-max-ziplist-value':        '[number]',
	'list-max-ziplist-entries':      '[number]',
	'list-max-ziplist-value':        '[number]',
	'set-max-intset-entries':        '[number]',
	'zset-max-ziplist-entries':      '[number]',
	'zset-max-ziplist-value':        '[number]',
	'hll-sparse-max-bytes':          '[number]',
	'activerehashing':               '[yes/no]',
	'client-output-buffer-limit':    '[class] [hard limit] [soft limit] [soft seconds]',
	'hz':                            '[number]',
	'aof-rewrite-incremental-fsync': '[yes/no]',
	'aof-load-truncated':            '[yes/no]',
	'latency-monitor-threshold':     '[number]' 
}

Release History

0.3.0

  • Separated code to make it more readable
  • Added option to run server in process.

0.2.0

  • Big rewrite to support new functions
    • New config option: start_retry_count. Re-try logic if service do not want to start.
    • It is now valid to start an uninstalled service, this will issue a install command before starting.
    • It is now valid to uninstall a running service, this will issue a stop command before uninstalling.
    • New action supported: status. Log the status of the service to console output.

0.1.2

  • Updated description of project

0.1.1

  • Fixed path to redis-server.exe
  • Updated redis conf names with '-signs, so that the conf-object will be valid js
  • Prettified output

0.1.0

  • Initial release