Catalog npm
Back to packageRELEASE DETAILS

0.4.1

npm

18xx-schemas

Schema files for 18xx-maker game and tile files

Published2 May 2020
Direct dependencies9
Transitive dependenciesNot calculated

README

Current package documentation

18xx-schemas

This repository contains the game and tile schemas that 18xx-maker uses for it's game files.

CLI Usage

Install this package gives you a 18xx-schemas binary that takes in any number of globs and validates each file it can find. If a file doesn't exist it just ignores it. It then pretty prints the validation output using ansi colors on the terminal.

# Validate some files
18xx-schemas games/*.json tiles/**/*.json config.json

# Display all options
18xx-schemas -h

# Output version
18xx-schemas -v

Be warned that if you pass a json that doesn't conform to any of the 18xx-maker json schemas it will be validated against the tiles schema.

Programatic Usage

You can use this package in your javascript to validate game files using two functions:

const validate = require("18xx-schemas");

// If you have some json you can validate it directly:
const json = require("18Awesome.json");
let result = validate(json);

// If you want to include data in the result you can optionally pass the file used:
result = validate(json, "18Awesome.json");

// Or you can use a helper which will load the json from a file:
result = validate.file("18Awesome.json");

// In either case you get a result object that looks like:
// {
//   valid: true if validation succeeded (boolean)
//   id: the schema id of the schema used to validate this file (string)
//   file: the filename of the file loaded (not available on validate unless you pass it in) (string)
//   error: error message if we had trouble reading the passed in file (only on validate.file) (string)
//   validationErrors: error object from ajv which has all validation errors in it (object)
// }

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 9

Native requirements
9 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
ajv
Environment
{
  "local_name": "ajv",
  "alias": false,
  "peer_metadata": null
}
^6.12.2runtime
chalk
Environment
{
  "local_name": "chalk",
  "alias": false,
  "peer_metadata": null
}
^4.0.0runtime
commander
Environment
{
  "local_name": "commander",
  "alias": false,
  "peer_metadata": null
}
^5.1.0runtime
glob
Environment
{
  "local_name": "glob",
  "alias": false,
  "peer_metadata": null
}
^7.1.6runtime
ramda
Environment
{
  "local_name": "ramda",
  "alias": false,
  "peer_metadata": null
}
^0.27.0runtime
ajv-cli
Environment
{
  "local_name": "ajv-cli",
  "alias": false,
  "peer_metadata": null
}
^3.1.0development
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
>=4development
lint-staged
Environment
{
  "local_name": "lint-staged",
  "alias": false,
  "peer_metadata": null
}
>=10development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.0.5development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "6ab94171f335d10040504f59a6b56bdf07bcce55",
  "integrity": "sha512-N4d8r0OJR3z6zoFORLHP2cozbUknhagGqBXwKmnJkwO+4XhKkWyDPpF/ZMsVU8zhGn9wloG//JqBpyjgNpg7bA==",
  "tarball": "https://registry.npmjs.org/18xx-schemas/-/18xx-schemas-0.4.1.tgz",
  "fileCount": 14,
  "unpackedSize": 32770,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerLvUCRA9TVsSAnZWagAAm/MP/AtDQ87NNDcCF6Xx5z/9\nAPYIEb39zvSzrohiI8edyLmtO85OLYhLKsGXuxys+buEjuf4ZOSbhZQQyDBf\nH4v3fKwCxqcnzVPJRNxlHLfkkxXBS4Xvy6grSsSNm/4Bwqp7xjnVr8nbNwSc\naag9P5M9NTHZ4fUYxuYACspYdMYZh19iZFf4JMcb/0ff5jbFKZtwzAaZFx34\nnofi+raDyCB4HSo49bvVlVi3v5PfFdmZJZMUj9whJJYyKq4l3Jbr7KJbOkp1\nPNS80zmxvBJFRtKC4R/h7fgEpmrpoax9HO6jTsHt+kej8JRXEciTothd2qST\na29GZVDj5i+bHerOc6EiIGIKNY6TsnCzeBgn219/geoQbGts0sNGrNIV8ghf\nfMj+w37hD9/kArGHRW793OslFKpRVORdQf84JV9rEq/2lSzNWxk9a1vIQlcK\njC5BXqkDGK6LBzwlJs6i9yG2AX4eH5+ACQ8tTIzmf0VPLSZaSmLL4NZDBb9U\nhrSTkWj4GMPTe2CdZAcfcSs+g2RPS6S0bv3i6jz3hPKfx638UnjmPZSMXouC\nUUex8+i+/UpHIc6cfkPHMQKHksNpf4wZlWGGeTJYjQyBh7I4en/FYO6QwxFt\nA0MTjwEzOeghGu6ug7boKAExbcteWLpKGKSwSdbHwIFggTcTZimfLuo0BplW\nSKmr\r\n=AjXg\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIB06M32OvQ7kOx0eCUcBfmk77EKFY0yXPWCExfAlxj41AiEA+cT9cEt/6MFmmRi3wC6tf0oNHUtKq9KGaOYx9jDpyR4="
    }
  ]
}

Repository

PENDING
18xx-maker/18xx-schemas

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:22 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:562c61b2df605f6c7a22bca167d2d3d829b26a3804388969a77c7a1fc736652d

Other collected versions

0.4.01 May0.3.01 May0.2.01 May0.1.01 May0.0.11 MayView all collected versions →