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

shipit-shared

v4.4.2

Published

Symlink unsourced files and directories, like Capistrano.

Downloads

8,745

Readme

shipit-shared

Build Status Dependency Status devDependency Status Join the chat at https://gitter.im/timkelty/shipit-shared

A set of tasks for Shipit used for symlinking persistent (un-sourced) files and directories on deploy.

Based on the concept of linked_files/linked_dirs from Capistrano

Features:

  • By default, the shared task is triggered on the updated event from shipit-deploy
  • All necessary directories are always created for you, whether you are linking a file or a directory.
  • Optionally set permissions on files.
  • Works via shipit-cli and grunt-shipit

Roadmap

  • Optionally copy example files, such as example config files

Install

npm install shipit-shared

Usage

Example shipitfile.js

module.exports = function (shipit) {
  require('shipit-deploy')(shipit);
  require('shipit-shared')(shipit);

  shipit.initConfig({
    default: {
      shared: {
        overwrite: true,
        dirs: [
          'public/storage',
          {
            path: 'db',
            overwrite: false,
            chmod: '-R 777',
          }
        ],
        files: [
          'config/environment.yml',
          {
            path: 'config/database.yml',
            overwrite: false,
            chmod: '755',
          }
        ],
      }
    }
  });
};

To trigger on the deploy published event, you can simply deploy:

shipit staging deploy

Or you can run the tasks separately :

shipit staging shared
    shipit staging shared:create-dirs
    shipit staging shared:link
        shipit staging shared:link:dirs
        shipit staging shared:link:files

Options shipit.config.shared

shared.dirs, shared.files

Type: Array

An array of files/directories to symlink into current. String values inherit default settings, objects allow per-item configuration:

'public/storage'
{
  path: 'db',
  overwrite: true,
  chmod: '-R 777'
}

path

Type: String

Path to the shared file/directory (relative to current).

overwrite

Type: Boolean

If the target of the symlink exists in current, remove it before creating symlink.

chmod

Type: String

Options passed to the chmod command for the given path.

shared.basePath

Type: String Default: path.join(shipit.config.deployTo, 'shared')

The path where your shared files reside.

shared.overwrite

Type: Boolean Default: false

If true, the target of your symlink (in current), will be removed (via rm -rf) before creating the symlink. Under normal circumstances, this is fine, as files in current have come directly from a git checkout.

If false and the target of your symlink is a file or directory, and error is thrown and the task aborted.

The default setting of false is a safety precaution to prevent unintentionally losing data. See https://github.com/timkelty/shipit-shared/issues/17

shared.symlinkPath

Type: String Default: shared.basePath

The path that will serve as the source for your symlink. This is usually the same as shared.basePath, however it can be necessary to set this in a chroot environment.

shared.triggerEvent

Type: String, Boolean Default: updated

Trigger shared task on given event name. Set to false to prevent task from listening to any events. (note: Some part of shipit-shared besides initConfig needs to be run before it can listen for events)

Events

  • shared
    • shared:prepare
      • shared:create-dirs
        • Emit event sharedDirsCreated
      • shared:set-permissions
        • Emit event sharedPermissionsSet
    • shared:link
      • shared:link-dirs
        • Emit event sharedFilesDirs
      • shared:link-files
        • Emit event sharedFilesLinked
    • shared:end
      • Emit event sharedEnd

License

MIT