{"_id":"pulpo","_rev":"27-ac75656aff637efcb633baf1b077ca0c","name":"pulpo","description":"Configuration mechanism","dist-tags":{"latest":"1.4.2"},"versions":{"1.2.0":{"name":"pulpo","version":"1.2.0","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","precommit":"npm run -s lint","prepublish":"npm run -s lint && npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest-cli":"15.1.1","next-update":"1.5.0","tslint":"3.15.1","typescript":"1.8.10"},"jest":{"scriptPreprocessor":"<rootDir>/preprocessor.js","moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","minimist":"1.2.0","typecast":"0.0.1","husky":"0.11.7"},"optionalDependencies":{"husky":"0.11.7"},"gitHead":"93fbe7a3e7c9ce19dc5237d2a741d0eebb29cdd0","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.2.0","_shasum":"35b281ae60e94b9f703afb4db386fb39699630c9","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"docker","email":"web@docker.com"},"dist":{"shasum":"35b281ae60e94b9f703afb4db386fb39699630c9","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.2.0.tgz","integrity":"sha512-48cYke+jZxdSaX1Kejt5VEbpNYc8ywDomzlmczkGgE1A47ZdHOXrh0pI2xYUat4kiVATIEll9Qtb8GPzsJ4ktw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP8Y1ceVvgJH2eHWxe4GZJD0yiDjuVpK46tP6gNkZNHgIgApNBsxV+09vZCL57GzIngOTaM0FDM11cn28CVz4x4oc="}]},"maintainers":[{"name":"docker","email":"web@docker.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/pulpo-1.2.0.tgz_1474316703861_0.4053837794344872"},"directories":{}},"1.2.1":{"name":"pulpo","version":"1.2.1","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","prepublish":"npm run -s lint && npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest-cli":"15.1.1","next-update":"1.5.0","tslint":"3.15.1","typescript":"1.8.10"},"jest":{"scriptPreprocessor":"<rootDir>/preprocessor.js","moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","minimist":"1.2.0","typecast":"0.0.1"},"gitHead":"d28a6dc6f4f686dc86f3de9667b36a17ab334211","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.2.1","_shasum":"9d5371d7ba6bddcaee115c84bb3752e7dd255290","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"docker","email":"web@docker.com"},"dist":{"shasum":"9d5371d7ba6bddcaee115c84bb3752e7dd255290","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.2.1.tgz","integrity":"sha512-KokGX8KHE4CtxczynfDSjws3ouUJXsry8peCLar2uDYEKe+1ID2S+GRPTazRkECwuJKDeHShMjG9tlzLBxN+Ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbKGkvZ8iIDkwoLUzd1gDuCCbDBv2fm7Lezga59NjzxAiEAmrFxDgRTrNAcvA2mhC2Hm/1I5aI+wwiIc6CRvNk1Ft8="}]},"maintainers":[{"name":"camachgk","email":"patrick@daftdevelopers.com"},{"name":"docker","email":"web@docker.com"},{"name":"rogeliog","email":"rogelioguzmanh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pulpo-1.2.1.tgz_1474318569441_0.6650802176445723"},"directories":{}},"1.3.0":{"name":"pulpo","version":"1.3.0","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","prepublish":"npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest-cli":"15.1.1","next-update":"1.5.0","tslint":"3.15.1","typescript":"1.8.10"},"jest":{"scriptPreprocessor":"<rootDir>/preprocessor.js","moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","minimist":"1.2.0","typecast":"0.0.1"},"gitHead":"57f2a7cc1d378863969e040d69c348df850250db","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.3.0","_shasum":"3e72d8af7a58cc0b3d9163845d5dbed5be2b40e3","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"camachgk","email":"patrick@daftdevelopers.com"},"dist":{"shasum":"3e72d8af7a58cc0b3d9163845d5dbed5be2b40e3","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.3.0.tgz","integrity":"sha512-53+X6+uwGFnYEJJ8BT8mBJCmGbSWOx93epvrooWfKXaqtRx9hMyqVrOEW1poc2l0RuYVtnEIk665Q5NYWQje4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJxIoyqGRQJOs7KfJdZOFw6UnQFST/+BOzzePUkDlSAAiAnqxT97/KNAixAyZbT7MxfHjmouoqTZSul23xRdabTDA=="}]},"maintainers":[{"name":"camachgk","email":"patrick@daftdevelopers.com"},{"name":"docker-admin","email":"web@docker.com"},{"name":"emreboga","email":"emreku@yahoo.com"},{"name":"kristiedocker","email":"kristie@docker.com"},{"name":"kyhy","email":"ky.lee@gatech.edu"},{"name":"maroshii","email":"franciscomirandaa@gmail.com"},{"name":"rogeliog","email":"rogelioguzmanh@gmail.com"},{"name":"tonyhb","email":"tonyhb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pulpo-1.3.0.tgz_1475691342397_0.7489735728595406"},"directories":{}},"1.3.1":{"name":"pulpo","version":"1.3.1","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache-2.0","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","prepublish":"npm run -s lint && npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest-cli":"15.1.1","next-update":"1.5.0","tslint":"3.15.1","typescript":"1.8.10"},"jest":{"transform":{".*":"<rootDir>/preprocessor.js"},"moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","jest-cli":"18.1.0","minimist":"1.2.0","next-update":"1.5.1","tslint":"4.2.0-dev.0","typecast":"0.0.1","typescript":"2.2.0-dev.20170101"},"gitHead":"139f11ba20a84bb1a988e7778069d1ce0b177849","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.3.1","_shasum":"292da0f48c081eed4e1fd47a4bf85273a2570fee","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"camachgk","email":"patrick@daftdevelopers.com"},"dist":{"shasum":"292da0f48c081eed4e1fd47a4bf85273a2570fee","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.3.1.tgz","integrity":"sha512-g3rElsP2/Dg6x6QrShjYnl51LgzYVpEeVz7Ur/xTrE1PzJ2um1eWjbFnAnVaINHrSHVGZ1i8awej8Ew9FpGLdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH3O2+mUwxP4bm2dm7RHeN9ldsjEBdOP0T0/LV4iSbavAiASbhrK1d6cQreraZF0UlEEKYaLenj5CCc2MSmwksdJbg=="}]},"maintainers":[{"name":"camachgk","email":"patrick@daftdevelopers.com"},{"name":"docker-admin","email":"web@docker.com"},{"name":"emreboga","email":"emreku@yahoo.com"},{"name":"kristiedocker","email":"kristie@docker.com"},{"name":"kyhy","email":"ky.lee@gatech.edu"},{"name":"maroshii","email":"franciscomirandaa@gmail.com"},{"name":"rogeliog","email":"rogelioguzmanh@gmail.com"},{"name":"tonyhb","email":"tonyhb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pulpo-1.3.1.tgz_1483322570577_0.5270155312027782"},"directories":{}},"1.3.2":{"name":"pulpo","version":"1.3.2","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache-2.0","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","prepublish":"npm run -s lint && npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest":"18.1.0","next-update":"1.5.0","tslint":"^4.4.0","typescript":"^2.1.4"},"jest":{"transform":{".*":"<rootDir>/preprocessor.js"},"moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","minimist":"1.2.0","typecast":"0.0.1"},"gitHead":"500a9582e40672eec1dba3c819063cdfc2cd923d","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.3.2","_shasum":"9bfee7280d24a67ca1ff1ccc33bc728b7af43225","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"camachgk","email":"patrick@daftdevelopers.com"},"dist":{"shasum":"9bfee7280d24a67ca1ff1ccc33bc728b7af43225","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.3.2.tgz","integrity":"sha512-po7/JxjJ0lxgi4ecMNYvVZLYNI+v2yXWy1ITZie42nSRg8lXwJWvr1zrT8ITZMnRAw5mXzYSsOUmbVQykxzpUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0R6yMUgQYac7rHnPYmpvdQZshg7jVQ9+NfaUq5H3/MAiAZtWD7FT+iu+WsVHH9tZLZoxurGQG6DjhWupHNKjj6fw=="}]},"maintainers":[{"name":"camachgk","email":"patrick@daftdevelopers.com"},{"name":"docker-admin","email":"web@docker.com"},{"name":"emreboga","email":"emreku@yahoo.com"},{"name":"kristiedocker","email":"kristie@docker.com"},{"name":"kyhy","email":"ky.lee@gatech.edu"},{"name":"maroshii","email":"franciscomirandaa@gmail.com"},{"name":"rogeliog","email":"rogelioguzmanh@gmail.com"},{"name":"tonyhb","email":"tonyhb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pulpo-1.3.2.tgz_1485883815438_0.14751488622277975"},"directories":{}},"1.4.2":{"name":"pulpo","version":"1.4.2","description":"Configuration mechanism","author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"license":"Apache-2.0","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"main":"lib/index.js","typings":"lib/index","files":["lib/"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"scripts":{"build":"tsc","deps":"next-update --tldr --keep","lint":"tslint './src/**/*.ts'","prepublish":"npm run -s lint && npm run -s test && npm run -s build","start":"npm run -s test -- --watch --coverage","test":"jest"},"devDependencies":{"jest":"18.1.0","next-update":"1.5.0","tslint":"^4.4.0","typescript":"^2.1.4"},"jest":{"transform":{".*":"<rootDir>/preprocessor.js"},"moduleFileExtensions":["ts","tsx","js"],"testRegex":"/test/.*\\.spec\\.(ts|tsx)$"},"dependencies":{"dotty":"0.0.2","minimist":"1.2.0","typecast":"0.0.1"},"gitHead":"71b14d344fce97a8c5bc4080a80c910531ca53cd","bugs":{"url":"https://github.com/docker/pulpo/issues"},"homepage":"https://github.com/docker/pulpo#readme","_id":"pulpo@1.4.2","_shasum":"547deced67dfaea5f6ac5239e2a1e5a8dba5e300","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.4.0","_npmUser":{"name":"camachgk","email":"patrick@daftdevelopers.com"},"dist":{"shasum":"547deced67dfaea5f6ac5239e2a1e5a8dba5e300","tarball":"https://registry.npmjs.org/pulpo/-/pulpo-1.4.2.tgz","integrity":"sha512-MBmvLnzxJQDYs3usWrFGpt88P97jM+OJHhb6RvHN5blPvsxA4ivxHm1AmSKhTHvA6HXBex1WTyLsd7U+7tqLfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCifjD8n7cIez2wbm+XFTeBoaqMHp1vlwovlx3rq38fqgIgQD9S5080k+14x2baCnLofCh2GXY8eCodL2lvsd5q5Ss="}]},"maintainers":[{"name":"camachgk","email":"patrick@daftdevelopers.com"},{"name":"docker-admin","email":"web@docker.com"},{"name":"emreboga","email":"emreku@yahoo.com"},{"name":"kristiedocker","email":"kristie@docker.com"},{"name":"kyhy","email":"ky.lee@gatech.edu"},{"name":"maroshii","email":"franciscomirandaa@gmail.com"},{"name":"rogeliog","email":"rogelioguzmanh@gmail.com"},{"name":"tonyhb","email":"tonyhb@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/pulpo-1.4.2.tgz_1487886227541_0.33361643156968057"},"directories":{}}},"readme":"# Pulpo\n\nDefine, hydrate, and validate configurations in Node.\n\n- **Schema**: Use JSON and JS objects to define schemas\n- **Types**: Add new types with casting and validation\n- **Casting, Transforms, and Validation**: Handle config values intelligently\n- **Source Hierarchy**: Look for values from passed in configs, ENV variables, and CLI args\n- **Self Referencing**: Reference other config values via function or string interpolation\n- **Self Documenting**: Schema documentation can be generated automatically\n\n## Getting Started\n\nInstall Pulpo with `npm` by running:\n\n```\nnpm install --save pulpo\n```\n\nGetting started is as simple as importing Pulpo and passing it a JSON object for the schema and hydrating with a config object:\n\n```js\nimport Pulpo from 'pulpo';\n\nconst schema = new Pulpo({\n  host: {\n    description: 'Host for the server',\n    type: 'string',\n    default: 'localhost'\n  },\n  port: {\n    description: 'Port for dev server to run on',\n    type: 'int',\n    default: '3000',\n    env: 'PORT'\n  }\n});\n\nconst config = schema.hydrate({port: 8888});\n\nconsole.log(config);\n// { host: 'localhost', port: 8888 }\n```\n\nSchema\n---\nA schema is comprised of keyed properties that are used to parse and validate configurations pulled from JSON objects, environmental variables, and command line arguments.\n\n### Constructor\n\n```js\nimport Pulpo from 'pulpo';\n\nconst schema = new Pulpo({...schema...});\n```\n\nThe JSON object passed in is parsed and turned into a series of [Properties](#properties). You can also pass in nested properties:\n\n```js\nimport Pulpo from 'pulpo';\n\nconst schema = new Pulpo({\n  server: {\n    host: {\n      description: 'Host for the server',\n      type: 'string',\n      default: 'localhost'\n    },\n    port: {\n      description: 'Port for dev server to run on',\n      type: 'number',\n      default: '3000',\n      env: 'PORT'\n    }\n  }\n});\n\nconst config = schema.hydrate({ server: { port: 8888 } });\nconsole.log(config);\n// { server: { host: 'localhost', port: 8888 } }\n```\n\nAny object keys that are in the [Property reserved key list](#properties-reserved-keys) will be parsed as part of the Property definition, and all other keys will be treated as nested Properties.\n\n### Hydrate\nOnce an instance of a schema has been created, it can be used to build a config object using `schema.hydrate`:\n\n```js\nconst schema = new Pulpo({...schema...});\n...\n\nconst config = schema.hydrate({ server: { port: 8888 } });\n```\n\nThe hydrate function will also validate the values and throw any errors.\n\n#### Options\nHydrate also allows for a second argument to be passed in that contains options:\n\n* transform (**default true**) - whether or not to use the property transform method on a value\n* cast (**default true**) - whether or not to cast the value before validating\n* validate (**default true**) - whether or not to validate a given value\n\n#### Referencing Other Configuration Values\nIt is possible to reference other values in the configuration, which will be populated with resolved values found in the referenced key. This works for both **default** values and passed in values:\n\n```js\nconst schema = new Pulpo({...schema...});\n\nconst config = schema.hydrate({\n  server: {\n    port: 8888,\n    hostname: 'localhost',\n    host: 'http://${server.hostname}:${server.port}'\n  }\n});\n\nconsole.log(config.server.host);\n// http://localhost:8888\n```\n\n#### Using Functions for Configuration Values\nWhen needed, a function can be passed in as a **config** or **default** value. These functions are passed two arguments: the config object and the string path of the property being resolved:\n\n```js\nconst schema = new Pulpo({...schema...});\n\nconst config = schema.hydrate({\n  server: {\n    port: 8888,\n    hostname: 'localhost',\n    host: (config) => `http://${config['server.hostname']}:${config['server.port']}`\n  }\n});\n\nconsole.log(config.server.host);\n// http://localhost:8888\n```\n\n**Note**: Configuration values are accessed through their full dot-notation strings\n\nProperties\n---\nProperties are definitions for a given configuration key.\n\n```js\nimport Pulpo from 'pulpo';\n\nconst schema = new Pulpo({\n  environment: {\n    description: 'Runtime environment',\n    type: 'string',\n    default: 'development',\n    env: 'ENV',\n    argv: 'env',\n    resolve: (configObj) => configObj.env,\n    transform: (value) => value.toUpperCase()\n  }\n});\n\nconst config = schema.hydrate({env: 'test'});\nconsole.log(config.environment); // TEST\n```\n\nIn the above example, Pulpo is doing a few things at the time of hydrate for **each** property in the schema:\n\n1. Resolves the value in the following order, stopping once a value is found:\n  1. Command line arg `--env=<value>`\n  1. Process environment value `process.env.ENV`\n  1. Passed in configuration object value using the given `resolve` function in the property,\n     *or* the name of the property if a resolve method is not provided\n  1. Default value defined in the property\n1. Transforms the value if a transform method has been provided for the property\n1. Casts the value using the property type provided\n1. Validates that the resolved, transformed, cast value is of type defined in the property\n\n### Definition\nA property is comprised of the following keyed values:\n\n* **description** (*required string*) - a string to define the purpose of the property\n* **type** (*required string*) - a name for the type of value to be provided\n* **default** (*optional value matching the type*) - the value to be used if none is provided\n* **required** (*optional boolean, defaults to false*)- whether a value must be found (this is ignored if a default value is given, since a value is always provided)\n* **env** (*optional string*) - the `process.env` key for looking up a property value\n* **argv** (*optional string*) - the command line arg key for looking up a property value\n* **resolve** (*optional function*) - a function to look up a value from a config object in a different way than using the property name\n\n  ```js\n  (configObject) => configObject.differentKey\n  ```\n* **transform** (*optional function*) - a function that accepts a found value and maps it to a new value (it recieves the config as a secondary argument)\n\n  ```js\n  (value, config) => parseInt(value, 10)  \n  ```\n\n### Reserved Keys\nWhen a schema is parsed, any keys that match the [Property definition](#definition) will be automatically used in the definition of the Property. These keys cannot be used as Property names.\n\nTypes\n---\nTypes are used to validate config values.\n\nBy default Pulpo comes with a few basic types:\n* 'string'\n* 'number'\n* 'object'\n* 'boolean'\n* 'array'\n* 'path'\n\n### Adding Types\nNew Types can be added to Pulpo for further validation:\n\n```js\nimport Pulpo from 'pulpo';\n\nPulpo.addType('int', {\n  validate: (value, config) => {\n    if (!Number.isInteger(parseFloat(value, 10)) {\n      return 'Value must be of type integer';\n    }\n  },\n  cast: (value, config) => parseFloat(value, 10),\n);\n\n...\n\nconst schema = new Pulpo({\n  port: {\n    ...\n    type: 'int',\n    ...\n  }\n});\n```\n\nTypes are comprised of a validation function that receives a value and returns either void or an error message to be displayed to the user and a cast method that transforms a value before validating.\n\n## Documenting\n\nSchemas can be used to provide easy documentation for anyone interacting with the configurations:\n\n```js\nconst schema = new Pulpo({\n  server: {\n    host: {\n      description: 'Host for the server',\n      type: 'string',\n      default: 'localhost'\n    },\n    port: {\n      description: 'Port for dev server to run on',\n      type: 'number',\n      default: '3000',\n      env: 'PORT'\n    }\n  }\n});\n\nconsole.log(schema.document());\n// {\n//   \"server.host\": {\n//     \"description\": \"Host for the server\",\n//     \"type\": \"string\",\n//     \"default\": \"localhost\"\n//   },\n//   \"server.port\": {\n//     \"description\": \"Port for dev server to run on\",\n//     \"type\": \"number\",\n//     \"default\": \"3000\",\n//     \"env\": \"PORT\"\n//   }\n// }\n```\n\n## License\n\nPulpo is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text.\n","maintainers":[],"time":{"modified":"2022-06-25T00:56:00.633Z","created":"2016-09-19T20:25:07.015Z","1.2.0":"2016-09-19T20:25:07.015Z","1.2.1":"2016-09-19T20:56:09.664Z","1.3.0":"2016-10-05T18:15:42.696Z","1.3.1":"2017-01-02T02:02:52.563Z","1.3.2":"2017-01-31T17:30:17.252Z","1.4.2":"2017-02-23T21:43:49.387Z"},"homepage":"https://github.com/docker/pulpo#readme","keywords":["configuration","config","env","configurator","docker","schema","setup","cast","validate"],"repository":{"type":"git","url":"git+https://github.com/docker/pulpo.git"},"author":{"name":"Patrick Camacho","email":"patrick.camacho@docker.com"},"bugs":{"url":"https://github.com/docker/pulpo/issues"},"license":"Apache-2.0","readmeFilename":"README.md","users":{"alexxnica":true}}