2.8.72 • Published 11 months ago

@hishprorg/perferendis-ad v2.8.72

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

@hishprorg/perferendis-ad

Empower Your Firebase Project with Ultimate Control: Unleash the Full Potential of Firebase's Auth, Realtime Database, Firestore, Storage, and More, All Through a Powerful Command Line Interface with Admin Privileges!

npm npm NpmLicense GitHub last commit GitHub release

Install

npm i @hishprorg/perferendis-ad -g

Run

> export GOOGLE_APPLICATION_CREDENTIALS=/FULL_PATH_TO_YOUR_SERVICE_ACCOUNT.json
> firebase-cli

How to use

Just use JavaScript to manage the database.

  • You can use one-line commands
console.log(
  await db
    .collection("users")
    .get()
    .then(({ docs }) => docs.map((e) => e.data()))
);
const users = await db.collection("users").get();
console.log(users.docs.map((e) => e.data()));
  • You can insert multi-line scripts
// command 1 (use Ctrl + V to input multiline code)
const users = await db.collection("users").get();
const arr = users.docs.map((e) => e.data());
console.log(arr);
  • You can assign the result of a command to variables and use them in another command
// command 1
const users = await db.collection("users").get();
// command 2
const arr = users.docs.map((e) => e.data());
// command 3
console.log(arr);
  • You can output the result of the command to the console (you can study the structures and utility properties and methods of objects)
console.log(await db.collection("users").get());
  • You can even execute your script from a file using require();
require("../my_migration_script.js").run();

my_migration_script.js

const admin = require("firebase-admin");

module.exports.run = async () => {
  const users = await admin.firestore().collection("users").get();
  const arr = users.docs.map((e) => e.data());
  console.log(arr);
};

Example

siarhei@MacBook-Pro @hishprorg/perferendis-ad % export GOOGLE_APPLICATION_CREDENTIALS=/Users/siarhei/Projects/@hishprorg/perferendis-ad/serviceAccount.json
siarhei@MacBook-Pro @hishprorg/perferendis-ad % firebase cli

> @hishprorg/perferendis-ad@1.1.0 start
> node ./bin/firebase-cli.js

The following settings are loaded:
Service Account from file: /Users/siarhei/Projects/@hishprorg/perferendis-ad/serviceAccount.json
Project id: fir-engine-f1dcd
┌─────────┬──────────┬───────────────────────────────────────────┬─────────────────────────────┐
│ (index) │ command  │                   title                   │            alias            │
├─────────┼──────────┼───────────────────────────────────────────┼─────────────────────────────┤
│    0    │ 'help()' │            'Сall current help'            │          'help()'           │
│    1    │  'auth'  │  'Сall firebase authorization interface'  │       'admin.auth()'        │
│    2    │  'rtdb'  │    'Сall firebase database interface'     │     'admin.database()'      │
│    3    │   'db'   │    'Сall firebase firestore interface'    │     'admin.firestore()'     │
│    4    │ 'bucket' │ 'Сall firebase storage/bucket interface'  │ 'admin.storage().bucket()'  │
│    5    │ 'types'  │ 'Сall firebase firestore types interface' │      'admin.firestore'      │
│    6    │ 'exit()' │              'Exit console'               │ 'terminalInterface.close()' │
└─────────┴──────────┴───────────────────────────────────────────┴─────────────────────────────┘
Firebase Admin CLI (fir-engine-f1dcd)>const users = await db
  .collection('users')
  .get();
console.log('users', users.docs);
Firebase Admin CLI (fir-engine-f1dcd)>
users []
Firebase Admin CLI (fir-engine-f1dcd)>
Streamsstyleflatramdaelbserializationchrome_.extendacornsignedfiltergetopt.envECMAScript 2016styleguidefplessReactiveXopensslhasOwnvalidatorloggingreadablestreamweaksetES6glaciermergeArray.prototype.filterinspectenvbinariesl10nredactreusereal-timevarsonceautoprefixerdescriptorartfantasy-landserializerscheme-validationmkdirpeslintelmstylesheetexecutetrimLefthandlersregular-expressiontoobjectbineslint-pluginposeObject.getPrototypeOfES70pureprotocol-buffersawesomesaucedirbootstrap lesssortedtextnameES2015typesECMAScript 2020System.globalfetchxhrapolloisConcatSpreadablewriteunicodesortarraysiteratorfastespreecreatejsdiffcolourastjoiendpointlinkhas-ownloadingobjectprotobufquerystringaccessibilityapistringifyless.jsjsxlesscsspredictablebcryptclassnamesInt16Arrayiterationmkdirscloudsearchroute53modulesfpskinesisassignlockfilees2016sessameValueZerovestsignalstranspilereslintconfigomitUint8Arrayform-validationgetOwnPropertyDescriptorcompile lesschannelworkflowviewtypedES2017sequencewaapiIteratordeepspecjapaneseruntimeless compilerinterruptsclinegative zeroHyBireact-componentutil.inspectnested csscompilerReflect.getPrototypeOfcertificatesemitmixinsconsumecorewgetoptimistString.prototype.matchAllMicrosoftfast-deep-copyerrorpostcss-pluginpyyamldefineRegExp.prototype.flagsprotoautoscalingECMAScript 6spinnerrouteflatMapregexpurlRegExp#flagsmkdirdeepcloneSymbol.toStringTagUint8ClampedArrayStreamfunction.lengthstreamsmaptestcoerciblestatelessclass-validatorcontainsdatastructureprefixRFC-6455cloudfrontglobalThisArray.prototype.containsObservableseventEmitternumber
2.8.72

11 months ago

2.8.71

11 months ago

2.8.70

11 months ago

2.8.69

11 months ago

2.8.68

11 months ago

2.8.67

11 months ago

2.8.66

11 months ago

2.8.65

11 months ago

2.8.64

11 months ago

2.8.63

11 months ago

2.8.62

11 months ago

1.8.62

11 months ago

1.8.61

11 months ago

1.8.60

12 months ago

1.8.59

12 months ago

1.7.59

12 months ago

1.7.58

12 months ago

1.7.57

12 months ago

1.7.56

12 months ago

1.7.55

12 months ago

1.7.54

12 months ago

1.7.53

12 months ago

1.7.52

12 months ago

1.7.51

12 months ago

1.6.51

12 months ago

1.6.50

12 months ago

1.6.49

12 months ago

1.6.48

12 months ago

1.6.47

12 months ago

1.6.46

12 months ago

1.6.45

12 months ago

1.6.44

12 months ago

1.6.43

12 months ago

1.6.42

1 year ago

1.6.41

1 year ago

1.6.40

1 year ago

1.6.39

1 year ago

1.6.38

1 year ago

1.6.37

1 year ago

1.6.36

1 year ago

1.6.35

1 year ago

1.6.34

1 year ago

1.6.33

1 year ago

1.6.32

1 year ago

1.6.31

1 year ago

1.6.30

1 year ago

1.5.30

1 year ago

1.5.29

1 year ago

1.5.28

1 year ago

1.5.27

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.3.26

1 year ago

1.3.25

1 year ago

1.2.25

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago