Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@zenginehq/backend-firebase
Advanced tools
Helper library for working with znFirebase in Zengine backend plugins.
Helper module for working with znFirebase in Zengine backend Plugins.
npm i @zenginehq/backend-firebase --save
var $firebase = require('@zenginehq/backend-firebase')();
var workspaceId = 11111;
// Load data.
$firebase.load(workspaceId).then(function (data) {
console.log('it works!', data);
// data fetched from <firebaseRoot>/11111
}).catch(function (err) {
console.error(err);
});
// Save data.
var dataObj = {
'childRoute': someData
// someData could be any data type,
// but dataObj (2nd argument of .save()) must be an object
}
$firebase.save(workspaceId, dataObj).then(function () {
console.log('success!');
// someData was saved at <firebaseRoot>/11111/childRoute
}).catch(function (err) {
console.error(err);
});
// Delete data.
var recordId = 222
var deleteObj = {}
deleteObj[recordId] = null
$firebase.save(workspaceId, deleteObj).then(function () {
console.log('success!');
// the firebase route <firebaseRoot>/11111/222
// and all data it contained has been deleted
}).catch(function (err) {
console.error(err);
})
// Use arrays to formulate complex Firebase paths for both loading and saving.
var formId = 222
var recordId = 333
$firebase.load([workspaceId, formId, recordId, 'settings']).then(function (data) {
// This will expand to: <firebaseRoot>/11111/222/333/settings
console.log('it works!', data);
}).catch(function (err) {
console.error(err);
});
// You can also pass a long string if that's your thing.
$firebase.load('foo/bar/baz/' + workspaceId + '/etc');
Note about Deletions
Passing null
as the second argument of .save
will cause strange and unhelpful behavior.
Instead, pass an object with the endpoint(s) as the key(s) and null
as the value(s) for the second argument.
See Firebase docs for the underlying .update()
command that is called.
Ex:
// much regrets
$firebase.save([workspaceId, 'undesiredField'], null).then(function () {
//etc...
})
// all the good vibes
$firebase.save(workspaceId, {'undesiredField': null}).then(function () {
// great work, team!
});
See contributing doc
2.0.1 (2019-02-07)
<a name="2.0.0"></a>
FAQs
Helper library for working with znFirebase in Zengine backend plugins.
We found that @zenginehq/backend-firebase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.