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-webdav-deploy

v0.6.1

Published

Deploy your zipped code to your webdav directory for use with build systems such as bower

Downloads

4

Readme

grunt-webdav-deploy

Deploy a zipped archive to your webdav repository for use with build systems such as bower

Warning

This plugin contains destructive default options.

Getting Started

This plugin requires Grunt >=0.4.0 (supports Grunt 1.0.0)

Install the grunt-webdav-deploy plugin with this command:

npm install grunt-webdav-deploy --save-dev

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

grunt.loadNpmTasks('grunt-webdav-deploy');

The "webdav_deploy" task

Overview

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

grunt.initConfig({
  webdav_deploy: {
    options: {
      // Task-specific options go here.
      snapshot_path : 'http://example.com/snapshot',
      release_path : 'http://example.com/version',
      baseDir : './'
      basic_auth: false,
      strategy : 'SNAPSHOT',
      snapshot_filename : 'SNAPSHOT',
      overwrite_release : false,
    },
    deploy: {
      // Target-specific file lists and/or options go here.
      files: {
        src: ['a/file', 'a/directory', 'all/files/in/dir/*', '*glob*'],
      }
    },
  },
})

Options

options.snapshot_path

Type: String Default value: none Required: (release === SNAPSHOT)

A string value that defines the repository path for snapshots.

http and https are supported

options.basic_auth

Type: Boolean Default value: none Required: false

Basic auth of the form user:password@ is supported.

The username and password are expected to be available in the environment variables

WEBDAV_USER
WEBDAV_PASS

Differing release credentials can be set in

WEBDAV_RELEASE_USER
WEBDAV_RELEASE_PASS

options.release_path

Type: String Default value: none Required: (release === RELEASE)

A string value that defines the repository path for releases.

http and https are supported, as is inline basic auth of the form:

http(s)://user:password@

options.strategy

Type: String Default value: SNAPSHOT Required : false

The deployment strategy, SNAPSHOT or RELEASE

Warning

The current archive at ${snapshot_path}/${snapshot_filename}.zip will be removed and replaced

A value of RELEASE will produce an archive name-${VERSION}.zip where VERSION is taken from the module's package.json

options.snapshot_filename

Type: String Default value: SNAPSHOT Required : false

The generated filename on the repository when using the SNAPSHOT strategy.

A value of TIMESTAMP will produce a file name representing the current timestamp (new Date().getTime()).

options.suffix

Type String Default value: zip Required : false

The suffix for the generated zip file

options.basedir

Type String Default value : './' Required : 'false'

The root directory to base the created zip file from

options.overwrite_release

Type: Boolean Default value: false Required: false

Whether the archive produced by the RELEASE strategy will be overwritten if it exists.

Warning

This is obviously destructive and will nag if set.

Usage Examples

Snapshot Options

In this example, the contents of the dev directory are put into SNAPSHOT.zip on the remote webdav archive

grunt.initConfig({
  webdav: {
    options: {
      snapshot_path : 'http://example.com/incoming/snapshots/myrepo'
    },
    files: {
      'dev/**/*'
    },
  },
})

Release Options

In this example, the contents of the production directory are put into mymodule-0.0.1.zip on the remote webdav archive

grunt.initConfig({
  webdav: {
    options: {
      release_path : 'me:user@https://example.com/incoming/releases/myrepo'
      strategy : 'RELEASE'
    },
    files: {
      'production/**/*'
    },
  },
})

Using the following package.json

{
  "name": "mymodule",
  "description": "An example of a module using the grunt-deploy-webdav plugin",
  "version": "0.0.1",
  ...
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code using Grunt.

Release History

  • 0.1.0 Initial release to NPM
  • 0.1.1 Added support for baseDir
  • ...
  • 0.5.1 Fixed image compression issues with node-zip thanks @xeroply
  • 0.6.0 Updated to support grunt 1.0.0
  • 0.6.1 Updated documentation