rebrandly-cleanup

1.0.3 • Public • Published

Rebrandly cleanup

Install

Install using this command

npm i rebrandly-cleanup

Usage

cleanupOldLinks accepts a rebrandly api key and either daysAgo or a custom filter as params.

daysAgo: If this is provided, any links created before X days ago will be deleted. This will delete daysAgo at the current time it is run, not the beginning of the day.

customFilter: a custom filter function for links to delete (this function can be asynchronous).

const { cleanupOldLinks } = require("rebrandly-cleanup");

(async function() {
  // Delete links made before 2 days ago
  const linksOlderThanTwoDays = await cleanupOldLinks(REBRANDLY_API_KEY, 2); // returns links that were deleted

  // Use a custom filter (can be async)
  const customFilteredLinks = await cleanupOldLinks(REBRANDLY_API_KEY, null, customFilterFunction); // returns links that were deleted
})()

Readme

Keywords

Package Sidebar

Install

npm i rebrandly-cleanup

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

3.58 kB

Total Files

3

Last publish

Collaborators

  • jakemaldo