1.0.0 • Published 7 months ago

@a-2-c-2-anpm/accusantium-sunt-ipsa v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@a-2-c-2-anpm/accusantium-sunt-ipsa

Exports a method which fetches the children keys of a Firebase Admin Database Reference via the REST API.

API Reference

The default export is a method with the following signature:

(ref[, options]) => string[]

Arguments

ref is a Firebase Admin Database Reference.

options is an optional object containing the following configuration options:

  • maxRetries - The maximum number of times to try to fetch the keys, in case of transient errors (defaults to 1).
  • retryInterval - The number of milliseconds to delay between retries (defaults to 1000).
  • agent - The HTTP(S) agent to use when requesting data (defaults to none).

Return Value

An array of strings representing the children keys of the provided Firebase Admin Database Reference. If the provided reference has no children, the return value will be an empty array.

Example Usage

const admin = require('firebase-admin');
const firebaseChildrenKeys = require('@a-2-c-2-anpm/accusantium-sunt-ipsa');

admin.initializeApp(
  // ...
);

const db = admin.database();
const fooRef = db.ref('foo');

// Fetch all children keys of fooRef.
firebaseChildrenKeys(fooRef)
  .then((keys) => {
    if (keys.length === 0) {
      console.log('No children keys found.');
    }

    keys.forEach((key) => {
      console.log('Found child key:', key);
    });
  })
  .catch((error) => {
    console.log('Failed to fetch children keys:', error);
  });

// Fetch all children keys of fooRef, with an optional configuration.
firebaseChildrenKeys(fooRef, {
  maxRetries: 5,
  retryInterval: 500,
})
  .then((keys) => {
    if (keys.length === 0) {
      console.log('No children keys found.');
    }

    keys.forEach((key) => {
      console.log('Found child key:', key);
    });
  })
  .catch((error) => {
    console.log('Failed to fetch children keys:', error);
  });
concatendpointjasminetoStringTagjestprototypeelbtypesafe[[Prototype]]parsercollectionwrapbatchasynces2018ajvstatelessfileconcurrencyproxyreduceryupeventses2017monorepohooksdeleteObject.getPrototypeOfbuffersmimetypeswalkliverecursiveRxmodulesconsumees7dataviewcallbackdotenvfindLastIndexrapidupemojiguidlanguageidbluebirdworkflowec2rmdirpatchYAMLchaipackage managerassigndeterministicindicatortddRegExp.prototype.flagsescapeObject.valuesloadinggetintrinsicreact-hook-formSymbolloggerJSONomitzeromatchrangeerrorplugingdprequalitydataspinnerentriesbrowserlisteventDispatcherwgetopenes5takeES2018file systemcall-boundchromeES7less.jsfpsSymbol.toStringTagoptimistagentfluxvalidationyamlcryptotoArrayaccessoramazonassertionbddshimdescriptionlazywatcherTypeScripttypaniongraphqlstreamansiemitastES2023TypeBoxString.prototype.matchAllreadablestreamECMAScript 2018jwtInt8ArraywriteString.prototype.trimarraysesshamlengthzodsymlinkmatchAlldom-testing-librarycallregular expressionsa11ytypeerrorES2022testloggingvariables in csswordbreakdebugwaitbyteWebSocketstextES2015clientimportexportfast-deep-copyES5rdsformssyntaxerrorclassescjkcompareJSON-Schemareal-timestructuredCloneexpresskeysstreams2setredux-toolkittapeeslint-plugin0includesdebuggerextrabootstrap lessUint16ArrayArray.prototype.findLastkarmai18nminimalArrayBuffer#slicedynamodbcachebuffermoduleES2016keyURLSearchParamsformattingratelimithashstdlibdependency managerECMAScript 2023symbolspropconfigvariablescurlfunctionscomputed-typesreact-hookswatchFilelastsortedarraybufferfromhelpersmiddlewareserializationshebangmapreducepromisesBigInt64Arraynativemkdir
1.0.0

7 months ago