Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @condenast/flyway-schema-validator with all npm packages installed. Try it out:

var flywaySchemaValidator = require("@condenast/flyway-schema-validator")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@condenast/flyway-schema-validator v9.13.0

A joi schema validator for flyways types

Flyway schema validator

Does what it says on the tin.

See https://conde-nast-international.github.io/flyway-api-docs/.

Installation

To use as a node.js module, make sure you're in your project source and run:

npm i --save @condenast/flyway-schema-validator

To use as a command line module, install globally with the following command:

npm i -g @condenast/flyway-schema-validator

Example Javascript Usage

const validator = require('@condenast/flyway-schema-validator');

const isValid = validator(someFlywayAPIObject);

try {
  // invalid
  const invalidThrows = validator({ invalid: true });
} catch (err) {
  // error describes the validation issues.
}

Example Command Line Usage

*nix Piping:

cat someObj.json | flyway-schema-validator

Reading from a file directly:

flyway-schema-validator -f ./someObj.json

Publishing Updates

To publish updates, you must bump the version number using npm version major|minor|patch, and push the generated commit and tag to github.

CI will detect a new tag push and automatically build and publish it.

Generally the workflow after merging a PR should be

git checkout origin/master -b publish-clean
npm version patch # <--- this also generates a git commit and tags it based on the new version
git push origin master # push that commit to master
git push origin --tags
git branch -D publish-clean

CI will now pickup and build your changes.

NOTE: we use a new branch that tracks origin master so if you have accidentally commited to master locally, that doesn't get published without any PR. If you're confident that your master matches origin EXACTLY feel free to do this on your local master branch.

License

MIT.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free