JoshuaKGoldberg / package.json-validator

Tools to validate package.json files
MIT License
107 stars 26 forks source link

PJV.validate is not a function #70

Closed Bruno-Marley closed 4 years ago

Bruno-Marley commented 4 years ago

I think it may be my mistake, but if it is I hope someone knows how to help me I'm using the npm package package-json-validator in a nodejs script and when I run the code it gives an error sayingPJV.validate is not a function

My script:

var PJV = require("package-json-validator").PJV;

const data = "{ "name": "test", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "package-json-validator": "^0.6.3" }, "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" }";

PJV.validate(data, "npm", { warnings: true, // show warnings recommendations: true // show recommendations })