![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
js-migrations
Advanced tools
npm install js-migrations
or kanso
A migration is an object with a version
and one or both of up
and down
functions, which migrate up to, or down from this version respectively. For example:
var myMigration = {
version: '1.2.5',
up: function(obj, callback) {
var num = parseInt(obj.a);
if (isNaN(num)) {
return { error: 'a is not a number' };
} else {
obj.a = num
return { error: false, result: obj };
}
},
down: function(obj, callback) {
obj.a = obj.a + '';
return { error: false, result: obj };
}
};
Version should be unique between migrations or there will be no way to tell which set of migrations have been run.
var migration = require('js-migrations');
var migrated = migration.migrate(
{ a: '42' },
[ myMigration ],
{ from: '1.1.5', to: '2.1.3' }
);
if (migrated.err) throw migrated.err;
var obj = migrated.result;
If from
or to
is omitted above there will be no lower or upper limit respectively. If both are omitted all migrations will be run. If from
is greater than to
then the down migrations are run.
All versions must follow the semver format.
FAQs
Migrate a JavaScript object
The npm package js-migrations receives a total of 4 weekly downloads. As such, js-migrations popularity was classified as not popular.
We found that js-migrations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.