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

@hwr-berlin-scheduler/database-updater

v0.0.5

Published

This library is part of an [open source project](https://github.com/hwr-berlin-scheduler). An effort to improve access to relevant information for affiliated persons at Hochschule fuer Wirtschaft und Recht Berlin, such as students and lecturers.

Downloads

3

Readme

HWR Berlin scheduler

This library is part of an open source project. An effort to improve access to relevant information for affiliated persons at Hochschule fuer Wirtschaft und Recht Berlin, such as students and lecturers.

database updater

build status code coverage npm version open issues license

This library written in TypeScript is used to simplify data updates of the remote database. It does not include the data retrieval itself but rather expects the data to be passed in an certain format. This data is then processed and finally persisted to the remote database.

As the current architecture is build around Firebase and its services the implementation stores the data into the Firebase Realtime Database. Thus the library expects a valid credential to be passed in order to access the database.

The used Firebase Cloud Functions service only runs on Node.js 6.x and thus all of the generated JavaScript is compatible with EC2015. This may change in the future when the Node runtime of Firebase is updated.

Usage

The library is available as npm package for direct use. If you want to take a look at and tinker with the source code read the contribution section below.

npm install @hwr-berlin-scheduler/database-updater

After installation you can run an update by retrieving an updater and passing it the lesson data, e.g.:

import * as functions from "firebase-functions";
import {DatabaseUpdaterProvider} from '@hwr-berlin-scheduler/database-updater'

// A valid firebase admin credential. If used in a cloud function one can retrieve one by calling:
let credential = functions.config().firebase.credential;
// the name of the database as in https://<databaseName>.firebaseio.com
let databaseName = "example";
// the user id the client should use if you don't want to use full admin privileges
// see https://firebase.google.com/docs/database/admin/start#authenticate-with-limited-privileges.
let userId = "bot";

let lessonData = ...

await DatabaseUpdaterProvider.getFirebaseDatabaseUpdater(credential, databaseName, userId).updateDatabase(lessonData)

Contribution

In case you found a bug or have a feature request open an issue on GitHub.

The full source code is available at GitHub aswell. Feel free to fork, tinker with it and make a PR to add features.

git clone https://github.com/hwr-berlin-scheduler/database-updater.git