Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dirkeeper

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dirkeeper

Prune a directory to contain a set number of sub-directories, retention policy is recency

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by60%
Maintainers
2
Weekly downloads
 
Created
Source

dirkeeper

Prune a directory to contain a set number of sub-directories, retention policy is recency. That is to say, oldest sub-directories are pruned first.

Installation

npm install dirkeeper

Usage


var keeper = require('dirkeeper')


// You wish to make '/myDir' only contain the 5 newest sub-directories

keeper({count: 5, baseDir: '/myDir'}, function(err) {
  if (err) throw err
  console.log("pruned")
})


A count of 0 means prune all sub-directories:


var keeper = require('dirkeeper')


// You wish to make '/myDir' contain no sub-directories:

keeper({count: 0, baseDir: '/myDir'}, function(err) {
  if (err) throw err
  console.log("pruned everything")
})


Additionally, a count >= the actual number of sub-directories means prune nothing.

Tests

Run npm test

License

BSD

Keywords

FAQs

Package last updated on 24 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc