Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
firebase-childrenkeys
Advanced tools
Fetch children keys of Firebase Admin Database References via the REST API
Exports a method which fetches the children keys of a Firebase Admin Database Reference via the REST API.
The default export is a method with the following signature:
(ref[, options]) => string[]
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).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.
const admin = require('firebase-admin');
const firebaseChildrenKeys = require('firebase-childrenkeys');
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);
});
FAQs
Fetch children keys of Firebase Admin Database References via the REST API
The npm package firebase-childrenkeys receives a total of 845 weekly downloads. As such, firebase-childrenkeys popularity was classified as not popular.
We found that firebase-childrenkeys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.