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

@examind/ltijs-firestore-scheduler

v0.1.6

Published

<div align="center"> <br> <br> <a href="https://cvmcosta.github.io/ltijs"><img width="360" src="https://raw.githubusercontent.com/Cvmcosta/ltijs/master/docs/logo-300.svg"></img></a> </div>

Downloads

11

Readme

LTIJS Cloud Function script to be used with LTIJS Firestore to purge stale documents.

Introduction

This package purges stale documents created by @examind/ltijs-firestore by deploying a Firebase Function that runs periodically.

Installation

Install Firebase CLI:

npm install -g [email protected]

Create a new empty folder and inside of it, initialize a Firebase project:

firebase init functions

Select the following options:

  • Are you ready to proceed (Y/n): y
  • Choose your account
  • Choose your project
  • What language would you like to use to write Cloud Functions? TypeScript
  • Do you want to use ESLint to catch probable bugs and enforce style? (Y/n): n
  • Do you want to install dependencies with npm now? (Y/n): y

Upgrade firebase-admin package inside the functions folder:

cd functions
npm install firebase-admin@latest

Install @examind/ltijs-firestore-scheduler inside the functions folder:

cd functions
npm install @examind/ltijs-firestore-scheduler

Replace contents of functions/index.ts with:

export { purgeStaleDocuments } from '@examind/ltijs-firestore-scheduler';

Optional: set environment variables to change deployment options:

process.env.CLOUD_FUNCTION_REGION = 'northamerica-northeast1';
process.env.CLOUD_FUNCTION_TIMEOUT_SECONDS = '300';
process.env.CLOUD_FUNCTION_MEMORY = '1GB';
process.env.CLOUD_FUNCTION_SCHEDULE = 'every 5 minutes';

export { purgeStaleDocuments } from '@examind/ltijs-firestore-scheduler';

Available deployment options:

| Environment Variable | Description | Default | | ------------------------------ | ----------- | ---------------- | | CLOUD_FUNCTION_REGION | Region | us-central1 | | CLOUD_FUNCTION_TIMEOUT_SECONDS | Timeout | 120 | | CLOUD_FUNCTION_MEMORY | Memory | 256MB | | CLOUD_FUNCTION_SCHEDULE | Schedule | every 15 minutes |

firebase deploy --only functions

Contribution

If you find a bug or think that something is hard to understand, please open an issue. Pull requests are also welcome 🙂

Publish

  • Bump version in package.json
  • npm install
  • Commit with message: Release {version, e.g. 0.1.6}