{"_id":"law","_rev":"36-e55f30f5232b3fe7840af7d6d0051b5b","name":"law","description":"Tools to create policy and validations for services.","dist-tags":{"latest":"1.2.0"},"versions":{"0.0.13":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.0.13","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"_id":"law@0.0.13","dist":{"shasum":"f7f90592910e9c038994964ede19d7db5a299c0e","tarball":"https://registry.npmjs.org/law/-/law-0.0.13.tgz","integrity":"sha512-JfGshIsMz8gbG2tOYxChzPyDbdH3n48Dz+zHYXtUDMdlqXSmAMZeaPQp+IZD+d7DewHJKi6BTgPnWYldx/khew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBiRqNZsMJDNtlejQBuejOj7Hc3AVEYYy3GnZFhjCoNAiBfxFeMAD6YHxKCeITtmkGF0F9O+9/o/i3t1SXZDXTuvw=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.1.0","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"_id":"law@0.1.0","dist":{"shasum":"d0a52d8e3830d41cafae79a2772ea6a839739f64","tarball":"https://registry.npmjs.org/law/-/law-0.1.0.tgz","integrity":"sha512-GxLTEw74V2u43fvIDU+OTgu60A0ZtnUpcxOCWIfa/GVn8YxAlH5JaJQWhGttLbnaw/hUgDUur+e9SOtB8eczbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGcqbyxz5Dq/WN9MgIN8hsIyZhT9eqHiTEdGye5ln/udAiAcY/ao58LaShougy5KeF00PMAnOtgygXi2967qYDLZ6w=="}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.1.1","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.1.1","dist":{"shasum":"8a0f9413ece74b21fe32331d649909ffc593128e","tarball":"https://registry.npmjs.org/law/-/law-0.1.1.tgz","integrity":"sha512-g3CKhzXz8IkSO/Hacby9QoWWmL8Hq+tvOvheUq2q2w1YuOovfTSvU6kfy6d95vrRB8T7LQfucWtz14HSdEW0ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCacgWmpUiplj/FE1VtOe2YnUvwwku0gdmaLHx8wbsMWwIgEZ83JYk72YuY5R49RXohGJOx7wRO7It2Z2d12qke/fI="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.2":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.1.2","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.1.2","dist":{"shasum":"524b69529140aeff9f4cc1024dce0e3608b3fc4e","tarball":"https://registry.npmjs.org/law/-/law-0.1.2.tgz","integrity":"sha512-5RXFM3DS/U6werRk+PXmJmed8E42JEfefSUO7WxzzzfkvFdOWWtvD9bmjoKGTa99JBQC4abgoE/uf4TBVRkx1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwSwlYOE/co+wI5kxevAKj6WUj6WSFfeVbVtreY7aggAiAlATX9e4sK5qsx1XetasmeCEZtmvQmL/HUy/5BTRKHKQ=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.0","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.0","dist":{"shasum":"c2728ec593581504581e8fac0382fd565ff441d2","tarball":"https://registry.npmjs.org/law/-/law-0.2.0.tgz","integrity":"sha512-IIR0zh3rHaF2KH1WdJBGIg0VAFna8NOIJnnBaQ3IcIKq9t68wZF11nnugk2q3UPwDZXW3k5JKdeIx1eQk1rz4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoUivyDhe9zLVUpBtgmxrGkDJ3j2tVRO18ZqejSAkjxAiEA6mbJiKBK0EXrdkCfWSkzGnNdeoB1OekZCRW6zgC7KkY="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.1":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.1","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.1","dist":{"shasum":"3591e351611554aa39dedce39a2a104d6e396a4d","tarball":"https://registry.npmjs.org/law/-/law-0.2.1.tgz","integrity":"sha512-zh0wta1KBgGC2085Wv2TY5HACD1He9hhGFtc1cMg9HazGWTo+9CZY3E+kLrqlw3oEdH7a44aiKVED0FVIK1aGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkVIcFrBWF8k/ky9WgRptiGKwjSonPAa4aaVKrHzdF9AiAyuDrB2QnbnDgRnWm9n/Ow/ldW9+xe+3EGI0f4yBdPug=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.3":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.3","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*"},"devDependencies":{"mocha":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.3","dist":{"shasum":"087f0cf448a5fc24fd2a0f9a3902da2c6dd00a0b","tarball":"https://registry.npmjs.org/law/-/law-0.2.3.tgz","integrity":"sha512-CEiK02+KUKVIeYlyTDd1kVPYAuZhUZHHqncSbV/MEoGVX7fGEhSTqPc8pvqccDPZ3eEg3LG2fs9MdynCyHjlYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENH5zti79jiIuX9B4ol0PP8KJG+8zONQR1Gc/88MxkYAiBdym3RIEoPW7rRy1DC4lUqvun8CgEsSfFocC4CH3xlmA=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.4":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.4","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Brandon Mason","email":"info@torchlightsoftware.com","url":"http://torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*","tea-error":"*"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.4","dist":{"shasum":"84a349bc1f23cefcade22295200a8c4a13a57653","tarball":"https://registry.npmjs.org/law/-/law-0.2.4.tgz","integrity":"sha512-gWfst3ijiJ2CEhUZpEq3AW1f4mFvm9BhdpCgzisYDQJ+NKiU0dRov4t4cpdXIHhjdAAD8x2D0RGblO9g140DNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCquzAJr+oYjwSXyzmeftS+9Oh9xrPVeFkgF29+NM5sxgIhANtV1Vmx89xaB3q+LYvzaCzsnyFT9mtuEd7l1J2LPSHk"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.5":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.5","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*","tea-error":"*"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.5","dist":{"shasum":"6b34b88ba33f2118e856f3e73c423b1d5f3faef1","tarball":"https://registry.npmjs.org/law/-/law-0.2.5.tgz","integrity":"sha512-1tO9PtLlT3Cvf/aJtaZEQy7cggz+WCpGkSKBGTkRYfLJSORTrP6lM4dV6W7X0YWd7fyh5LG48YxrH9Y8otBVnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxTrCilmfqAmbFNtYVCnU12/qmWzOVMiQNclEC3fb/7wIhANaOc6lNIkusu/5AS3oHmBPp6BxFAWPev7uexHgjzczN"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.6":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.6","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*","tea-error":"*"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.6","dist":{"shasum":"7a8212dbb72562d1490daeb19e0cf8a6795c4fee","tarball":"https://registry.npmjs.org/law/-/law-0.2.6.tgz","integrity":"sha512-sA17Az2d0ywTOqMnb0T5MWwLihthYutizYjDwjgOSI2fjNGuEayfTW8b+Yi+CbE2kdFvWmAdeaDZkEIeT/y8Qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw5PbyAIfiBcJZ7MoAOBv5XWHcS0nBhnoBGBEeukyWwgIgXvDC2W/2+Uw7EZ1ATmKpHkKAiRNnEtN5a/Yya4pXIPc="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.7":{"name":"law","description":"Tools to create policy and validations for services.","version":"0.2.7","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./index.js","dependencies":{"coffee-script":"*","tea-error":"*"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"172ce684b54e9d69372dd35e8b60fda248597f6d","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@0.2.7","_shasum":"ede2b9913940d29401c9cc46c4d2642dc440e4ce","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"dist":{"shasum":"ede2b9913940d29401c9cc46c4d2642dc440e4ce","tarball":"https://registry.npmjs.org/law/-/law-0.2.7.tgz","integrity":"sha512-Md8ZIRV0c2VocneQ69AXbnD5HPryGiq3dzABc9ua46uo8+DydL3B1W/zk/SH24Phn+gmyppNHA2eKBapk3XqKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDljDpyqg4PJ1ul5Vtl9JEsh7Y5RuZfQi8OmyRIsSdlQIhAJu6q/dpwZwDlBULNJnjjnSVoABISckhwYwOlBmPTjN9"}]},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.0":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.0.0","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"ec2e36d860a8eb93bf8ae904864431e1a48a7084","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-BJYTBisx8m7OYsJv9vBcT0VZp/M5er4w1VPHei5LcDjPnoQe2YYNNyEBsWwFRjwUZfgD1d5TqM0lyPvZI4jjOQ==","shasum":"0ed95d89459614bf6f58a7bdca1cfb5573619d65","tarball":"https://registry.npmjs.org/law/-/law-1.0.0.tgz","fileCount":40,"unpackedSize":65035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRpMMCRA9TVsSAnZWagAAcZ0P/2WbaA8pTWHyPVu6b1Vv\nlq4RpQ+c1n4hWIgGak29EW+Zs8STSamwgSyeEAnsywBb/Qs6nt6laoYlDe9P\nf2WUAM0spmqOcx5B2LUa+BK9zd7kgK46RrnMqO7oT9eqUx+bZhwwtDCmCH4q\nQVgORAF4Nqo2iFZnQ4T0+fXO4L/JqWHGiY5AHU3xsyMZxMULGvKXxe2jJjKF\nZvRzYJCCwkNAj7d79xmqqskr9+5o5HUgq0KF+VewDku3zZvahcXIB3bsF9q7\n9vlRrvRTA3hACRjWaOSDDpNPEwLCw0mJ4J/dadgR+zLoitcOmj51BAzRiSFg\nlK9RDchcRbq2eHYuY6oGnJchMOyRoWKdNKsTkeKqI4qwoMLjVRm+sqEAWxl+\n2jz9/w38kD2kAfwi5DymDbNvjzFP6KUVSAwsgrfxV9CGZf4K1MB1gCogadzn\n1EEGb4fqdrycoeJiMnAgTZrKJmNRUddkQT53GP0HztmGIH9JMzUEeUXpItbB\noj9nyxlG78Fm1pwirU78ekuY38ihR8yVf6+nRVBRkdPF2IwEC+k0Nk7GSH1X\nBFm+h+QCPgGjw/aIQndS8jS0Rdyj0tnQia0pjIsprCOfPtc2w6kxJYbxadqj\nDsVKWX6TBhW4Rl6ODmJ82W6Xu5VJGKBWmdEATlFSIz1vGSjnlupA3TI3XJc0\nwMB/\r\n=GNL7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCea33iimGyUYhif+eu8MsdCDabTddqj5mmHu5PSoe5WAIgZivXvMRCafhY77wCMAi4pFCjAM3BYt/9tcT7wJsjOuk="}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.0.0_1548129035442_0.4350445481342258"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.1":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.0.1","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"ec2e36d860a8eb93bf8ae904864431e1a48a7084","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-c1dtUP7fO8Lgsdm10y+eR2qdruh8RphZPM0e7NaLdQgVrur+FgP0xSHbLmxvl/wFW5jtHu/mRK4A2IDJ2KsVUg==","shasum":"99babb56a5839f8996055bc50d4bb2287f5a7703","tarball":"https://registry.npmjs.org/law/-/law-1.0.1.tgz","fileCount":17,"unpackedSize":35636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRpNZCRA9TVsSAnZWagAAQTAP/RNFkxURtVY7546ssjls\n/9KUPYtYl+oMefoJt0fYdBUXI77YF+irL25xx3mhaRj6MJVDbLQWmk0IwSrh\nh2Ebv9lOqtp4wKiwoyoZ2EMpQDGo/2zWxsyjF5I5DTVSttDb0bmjn5Re6E+w\nSyL4PmbeTIeXNVY5Nv7ooop4Gokqtjqclp0V5MOdjcG5oisxOSwO2Ix5tiS9\ndZrfFpyuEq+PfHnmVJGv1sHAoOnLqPYStWwVkgV0bHCMKyoHbIRabdz8HrPL\npxHyGPMsPvakHfAOcuYfz0iMpTrekLgVPIEpSdvOL5PRdMWdZYb+cVNRTDBN\ndXGJ82PpCLa6QWUFY+dHy5QCUQzSs1XYqbhPMoC6NeHPCxrLQgthTqnDcJOe\nDey2O9HigU1ZOC6uDlIQJ7LyOEXTMkfzVbXMfz4Dext/fJti1xhqqHPRQOzs\n4ytN5nAsvM70XIyCAtd5WilMCOVw6HFWYGEX72YHwaUanK/NxcMRzsuIs27A\nu4T0YajiisNP3nveFwjBhnraB3aQFQDB0BGvp/r4TBIhsd2G8Yse6FIf2gPg\nqC4OUWzo+8PxT/LhpQs5HgOy4Uz1uV5Q6rJ7Y1ZNJq34JECsHPLTj5Qv0vGk\nnc3WPXGfYA/+lchLP4T6UJwChvcPlxw59SjKyCRTmie1pG+BoSQFVW5GTEik\nrwP+\r\n=iDMJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDI2q4g1ot5WMeKNNjAcq1SLYoK7Gf+zlkOykromWO2WwIgNMXCtNq5jkI1E92Vu61t6pssH9e+jQiFfkSQLpcbuAQ="}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.0.1_1548129112457_0.25637574706342736"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.2":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.0.2","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"c05abf097820efefa4869459f776fcbdcbe8050c","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-ks7TISU1slt0yIKSC85ibOq9vlbrsMbRCftlTIOi/qLNJzcY99u3e1lRfsUcxUSiYF+Eh8EWv4eEMZ6pOcQS/Q==","shasum":"263c9e371def18ecfd923045711452809c1e8711","tarball":"https://registry.npmjs.org/law/-/law-1.0.2.tgz","fileCount":18,"unpackedSize":36266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRqzQCRA9TVsSAnZWagAAj6gQAJFA2Zs4oRdA7Rt+dcQP\n770dSXXv8lWNXiwmuGpuHwScydpHu80Fv4wEBa+V7WmBfoKZqBPN7mGHEh8x\nchsJtfxWWcE94OcqeyvtUxflByiI9GI6E8M1fmz1k6K6egzSH1MgAnMXHpLg\ntNlK91ZI2cqXmQwFKKpjIjCbmDle11HV7p+hC08xBTgyZMueT09GDdamxjVW\n/CTAWwBsZCF5za8Zg1nclNduVZeW3XsDxk0Iqs3c3Tmt67DhdxGITLVYUkjM\n0ECosO5VGT+/hR7i9hjsr7mUx1XuF1KVLGqDf35PwWR/5SFNtrqaxgtD+oAa\nNPfcG1FNYZFM1MtyxFRWvW2jKdotmY38IHKPkfVTZXUmBGH5QKQY91f7tNEJ\n6dtYcCXDoPoueo4zppXg2f5bk79Si9G6CvEt/YdOpa5xvPp22ftMqMDnIfmM\nYdpGORlXWiLd27MYLW4w6YGtT56pI7BUx1/mPU/1M1Gzxaz8PFnE/PDvvgXB\n6MNN7ST7UxRApfycG93RjyzaR5TXN5SsCJbCIMBDbDy27pYBz2DT/u62U3er\naFwytxKgMIg/IzLH4nTP0aZxsDly/Q2v1u5QKITxXe3OWjQ1JRNNCJLeeQZn\nSuEZy4F+zBamnZYevtEPKNgI69dTj4z9vSfpHw3At9mStiEyAQeYcf2x1q5+\nu0Ri\r\n=BBSs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+pH4shQLaOMxNoy9s3h2b/zMgBJkSwwv0p/MBs699TwIhAKiVOJT2HiXcDFPorN9jGE/Sxt9kVmUrY+/XiHzUgZPN"}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.0.2_1548135632012_0.5299381425924241"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.0":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.1.0","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"75484ba9a8276804e11e7659dd6f7b8413550462","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-w7yeqU4f6CRV13JP7RwAplLBLJ5nMdDHOxDqYzL6gbxXklLWIYRRKf4CflwPRsUU80UJ+J2OmS6rA5d8OW2Sqg==","shasum":"c228a51ddd99bb1872ae8b5bb1a64a72ee2e3686","tarball":"https://registry.npmjs.org/law/-/law-1.1.0.tgz","fileCount":18,"unpackedSize":37432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRt1CCRA9TVsSAnZWagAAoGcP/iZsx8elnMZTs/XezoXp\nW1bgwiXxIoE5dpwAELUUTkbFQhQOLvVLu6zjiUvO7N37ge8KDCJSS+p8iAdU\nDFi0gDySd1ePN75sisMjQ9DCVrM3Y/86oUf+isb81K8GMVArYlYtbqSDQSOw\npeLBbidw3grynfmmbrjTozusVLxlBwolPe3OYwftfzCB0iJfe2aA33pJ/YVu\nSM96LdnMIGACCI1D36Mil+77H1f1+GKeeSm3Lk6IUQi7BQ+9s42unnv+DVN0\nwk7MJP8rHOhiY9JVStZ7gLRZIqzM4EaLXDJKJSTblOfIkM5nKJPdKJ2IeraH\nYumEAEdyMVsRc3eca855h0BVp4BQoBZ4xfHniDZv8u2QwtmOz1q4zrRUgkuq\n5w/NlYvr+AtHMix9a36u3fXCg3xyyGGfBcZn7b0xcJPgCWPXs2ann2Dj5+LM\nm/XtAWcX8pL2QukWbn5DLvIzhefXmcV+cT+HK3fkKlqwwY4O8sEOnkCv6DMN\ngJpzAq1KO3V9MOtmrafcHeUxw6MXLepgKT/2LV3trfSKk0xVGLux41bVYKz8\nhrX8dkllpoV9UeAFLhgfzxp4doe5VOsoCEyGdYOSyu0Ry3xmaMVlXvhWAdZo\nbISVQQQguP+ZayrhL8U58VoQ7ZVOKQ+hpwJV6ANGUc0TntLR3SkDvM/kUDV6\nXCbA\r\n=eD73\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhnEvN4OTX8EcmjxfF6t70x4qsBIe65ln7QSCs9NK0rwIgIRTg55BGacmd4Pci3qI9oFefyX4rVHvwqOzbUpIAoyQ="}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.1.0_1548148033705_0.20745345448469266"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.1":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.1.1","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"706b6088a8b99fc4f40748827b93f404848d962b","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-3sLybklFE1Idk9Bp3df1+T4mGdaTqYZyFs8ZPbyU4qCiTmZHUiA9eZSjL5X2KtElvoPETnzKUv0U3J6QRcxOLQ==","shasum":"65a4b343ce7b2603d5383cea357f7758b41ef07e","tarball":"https://registry.npmjs.org/law/-/law-1.1.1.tgz","fileCount":18,"unpackedSize":37746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcR6mkCRA9TVsSAnZWagAAv6gP/RmAHwtryUEPeQh+FQzH\nMHltCRoT4mf6xOxdsCOd/3oC+IVUa88OB3Ka3VwDL/JstWukoO87k4FpDyiI\naCLC9WvQpUI50VjLXy0yQTVcycBzESyEkM05mIdMTp15rKU6BryzRvEaRMYu\nu+Ijp0E79tKnPwusnLDOqztQBxQQi4lBXf/kwFA+hpPLAttwO24OyPT5B5BE\nDogT+wARiXdP2fPvRfnRSnHc+0hKn+57wAyPX+fhK79DucllFnY3D7f/OVuz\n8z4SaFwr9eGjWclN5pWMvEIfwmRNZrvqMVk4oCtclQWxCLpa1o2NqPW+6tA9\nPDzq0VN3uvQg9B51IwINaoN0QzMEbje7rZnLH696NMMmo2d5Hx9jtGJSrrrm\nA9q4FS3r++a2y5Wp+eewJtKVVETrStBXpBrteQmDgiZ7Inh3iXm5UDYU0i2Z\n6TnTPszEjg4iPTRBPpIwnKcSI2t46IJIYO1QLvRu9UDVUOMIT1EmUhkbvpZy\nacKSG7Gs4HjJ+tquSL0l0N/kx+iSGlob4Auf+mViuonHw5xqDyGS6FtKd60q\nR7W+va73KnSEWOPtAAFQdslCqgJn5uYHHrHlRrkwywTpaM5lL67st9Qv3oXO\npHTGioN0zGsn3tGVMaRSy0DqKtA9gnX0XEiaKH+meDQpaE+9ZCAz0EUoqpE8\nn75x\r\n=qd/N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMd0ueYTMuu7Ks19vylR0tQyvguqHaKyqVEQA6c9COWAiArSP2tf7PJdHR8LU7RBEcsyA0LfuMBVbwYgWIVhIJ8Lg=="}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.1.1_1548200355475_0.4989559115294746"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.2.0":{"name":"law","description":"Tools to create policy and validations for services.","version":"1.2.0","homepage":"http://github.com/TorchlightSoftware/law","repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"main":"./lib/main.js","dependencies":{"tea-error":"^0.2.0"},"devDependencies":{"mocha":"*","torch":"*","should":"*"},"engines":{"node":">= 0.8.4"},"licenses":[{"type":"MIT","url":"http://github.com/torchlightsoftware/law/raw/master/LICENSE"}],"scripts":{"test":"mocha"},"gitHead":"fbf06ac8cbccf542728aae85a826781c7d2c8d3b","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"_id":"law@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"torchlight","email":"info@torchlightsoftware.com"},"dist":{"integrity":"sha512-WkZK2gzETxe/xxd2r+8Bo0SJZYzfimoWSpyCQZoCmKa0B17x88y8+iKBAXI3crwY/CxXr6qDS1wbAoSL5tA8dg==","shasum":"d8022bdd1b83fdbdecd043fcb913dc74c7279dc7","tarball":"https://registry.npmjs.org/law/-/law-1.2.0.tgz","fileCount":18,"unpackedSize":38316,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqWOnCRA9TVsSAnZWagAAz1oP/jvD6Cwhf/L6bdKLvk61\n72J3IYOh9Bg5wsw/fhyiVvoEoo75mgnzD1kkPcvNFSfTqLeg6Y55S+WBG4A/\n9mKPmjWQOpjAdZrwTkf361+A/DuL/UNOramDNp+7NoBgjSMDcgoU9FcSBwdZ\nfCj6HLFhQRhhFpLngttkVPc0f7aNBMyscnFsA2t6qyVC7F+SupklJm52OMFW\nQcpYz0LIyKUEerBvk+XruPpjtQL8C8jXuIfkHXvkuuxhLV5RVFKhJ/7zfI2x\nZIsGQtawRIf5J9XqPUgTjWqAA+CDeakAo3FOHJ+CwNmUBAitwbBWWb4NUYWc\n0j9cT3M0d4okw35TfLSiwPkal/x48YX/hvuOMKioDXbXapnsFFWgFCTIeMih\nHiR7qsLpAneON2bE1JqMORt7QAZdzdakVAeM87XxS0T8mRyQ5zVavVclw519\nBVIo7ucmDLiHlI9dTO3hzs7Q2CraRPkTRi0Wx7L+zYyFLMsGyR3CEKbVQqSE\n1MKb0TmxUturU+ariJia9CtjOJcvMBsijC8wZBCaJkagJrhlYJNJ0AVwAVx3\nhVtdY3FWvxDCWIZrWLwU7bUiI1tCrXhjFYS6et8pWvXDhO1PdXeo2jhvYUhh\nt/M/1lcGssLMQdU1BmGj8MFwZ/iQWhaiaHA4TvNRY/hKlUUxPi0K1PKWM7uj\nWq61\r\n=wyGa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHokZ0+p+FTgfMZ5YlszKJaqLwMOjpH5A8BGYgBP00UEAiB3GjVlTl5zMlJFQ4nYh7XLrjfwx3+7IijQCPRY+UnhaQ=="}]},"maintainers":[{"name":"torchlight","email":"info@torchlightsoftware.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/law_1.2.0_1554604966819_0.2842667019670353"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"# Law\n\nLess strictly constitutional and more strictly awesome.\n\nLaw lets you define services in a transport agnostic way.  Core features in Law are:\n\n1. required/optional params\n2. input validation\n3. access control policy\n\nLaw services are \"just javascript functions\".  In our applications, we have connected these services to REST, websockets, gRPC, and a programmatic API through the use of various adapters.\n\n![Build Status](https://api.travis-ci.org/TorchlightSoftware/law.png)\n\n\n## Sample Service\n\nThe simplest way to define a service is as a bare function that takes a param object and a callback:\n\n### getRole.js\n```js\nmodule.exports = ({sessionId, specialKey}, done) => {\n  // check the sessionId against the database\n  done(null, {role: 'Supreme Commander'})\n}\n```\n\nIf you're writing anything important, you're going to want some input validations for your service.  Law lets you do this declaratively by defining your service as an object instead, with some special fields that tell Law what kind of rules you want to be applied:\n\n### getRole.js\n```js\nmodule.exports = {\n  required: ['sessionId'],\n  optional: ['specialKey'],\n  service({sessionId, specialKey}, done) {\n    // check the sessionId against the database\n    done(null, {role: 'Supreme Commander'})\n  }\n}\n```\n\nWhen Law processes this definition, the end result is a *function with the same signature that you started with*.  So it still takes an object and a callback.  It just performs some validations before it runs your service.\n\n## Sample Validations\n\nNow, let's say you want to write some validations that do something more complex than just detect if the value exists.  Law provides a 'jargon' file for that, which you can think of as a set of type definitions.  Instead of being checked at compile time (e.g. TypeScript), they will be checked at runtime, whenever values from the outside world are being passed into your services.\n\nYou can also think of this as the language that a particular set of services share (Domain Driven Design).  Whenever these names are used in service arguments, their meanings will be enforced by the rules you set here.\n\nHere's some example argument types, and their validations:\n\n### jargon.js\n```js\nredisId = /[a-z0-9]{16}/\nmongoId = /[a-f0-9]{24}/\n\nmodule.exports = [\n  {\n    typeName: 'String',\n    validation: (arg, assert) =>\n      assert(typeof arg === 'string'),\n    defaultArgs: ['email', 'password', 'sessionId', 'userId']\n  },\n  {\n    typeName: 'SessionId',\n    validation: (arg, assert) =>\n      assert(arg.match(redisId)),\n    defaultArgs: ['sessionId']\n  },\n  {\n    typeName: 'MongoId',\n    validation: (arg, assert) =>\n      assert(arg.match(mongoId)),\n    defaultArgs: ['userId']\n  }\n]\n```\n\nYour validations just have to call `assert`, and in return you'll get beautiful error messages that tell you exactly what service was being called and which validation failed.\n\nHere's an example policy file.  Filters are just regular services.  If one returns an error, the call stack stops and returns it, otherwise the results are merged into the argument object and passed on to the next service in the call stack.\n\n### policy.js\n```js\nmodule.exports = {\n  filterPrefix: 'filters',\n  rules: [\n    {\n      filters: ['isLoggedIn'],\n      except: ['getRole', 'login']\n    },\n    {\n      filters: ['setIsOnline'],\n      only: ['dashboard']\n    }\n  ]\n}\n```\n\n## Why this is a good thing\n\nThrough this approach we accomplish the following:\n\n1. Decoupling between validations and domain logic\n2. Access control is described in one place\n3. The preconditions for services are declarative\n\nStandardizing on receiving arguments as an object allows Law to be very flexible and minimize your code maintenance costs.  You can always add new arguments, and new policy layers that are concerned with them.  Services that aren't concerned with the new arguments can ignore them and don't need to be modified.\n\nHaving your \"domain language\" explicit and in one file makes it very easy for newcomers to get familiar with the project.  Having the policy rules as a simple JSON object helps enormously in clarity, and to avoid mistakes in how they are applied.\n\nBecause the compositional tools are so good, we can write really small bits of code that are reusable.  This makes the code overall much easier to read and maintain.\n\nBecause the structure binding these pieces together is declarative, we can easily make it visible for analysis and troubleshooting.  Here is a printout from the sample application.\n\n```js\n#> console.debug(law.printFilters(services))\n\n{ dashboard: [ 'filters/isLoggedIn', 'filters/setIsOnline', 'dashboard' ],\n  'filters/isLoggedIn':\n   [ 'sessionId.exists',\n     'sessionId.isValid(SessionId)',\n     'filters/isLoggedIn' ],\n  'filters/setIsOnline': [ 'filters/setIsOnline' ],\n  getRole: [ 'sessionId.exists', 'sessionId.isValid(SessionId)', 'getRole' ],\n  login: [ 'login' ] }\n```\n\nThis tells you exactly what's going to happen when the `login` service executes.\n\n## Promise Support\n\nAs of 1.1.0, you can use promises and async functions with Law:\n\n```js\nmodule.exports = {\n  required: ['sessionId'],\n  optional: ['specialKey'],\n  service: async ({sessionId, specialKey}) =>\n    ({role: 'Supreme Commander'})\n}\n```\n\nWhen you call a Law service, if you don't pass a callback, you'll get a Promise:\n\n```js\nservices\n  .getRole({sessionId})\n  .then(results => console.debug(results))\n  .catch(err => {throw err})\n```\n\n## Dependencies\n\nSince version 0.1.1 Law supports declarative dependency injection.  The two built in loaders are:\n\n* services: call sibling services\n* lib: a shortcut to require\n\nThis lets us do static analysis of dependencies, and can be used as a way of making side effects explicit.\n\n```js\nmodule.exports = {\n    required: ['sessionId'],\n    dependencies: {\n      services: ['aHelperService'],\n      lib: ['lodash']\n    },\n    service: (args, done, {services: {aHelperService}, lib: {lodash}}) => {\n      args = lodash.merge({myOpt: 1}, args)\n      aHelperService(args, done)\n    }\n}\n```\n\nTo add more loaders, just plug in a resolvers object when you load your services:\n\n```js\nconst resolvers = {\n  myLoader: (name) => loadIt(name)\n}\n\nconst services = law.create({services, jargon, policy, resolvers})\n```\n\nYou can also use `*` if you want to receive all services (for instance if you are calling subservices dynamically).\n\n```js\nmodule.exports = {\n    dependencies: {\n      services: '*',\n    },\n    service: (args, done, {services}) => {\n      // call any service you want to here\n      services.aHelperService(args, done)\n    }\n}\n```\n\n\n## Getting Started\n\n```bash\nnpm install -S law\n```\n\nThe only dependency is `tea-error` and the final package size is `11kB`.\n\nLaw is a library, not a framework, so it doesn't make assumptions about location of your files.  You'll need something like the following to initialize and connect the services when your application starts.\n\n### initLaw.js\n```js\nconst {join} = require('path')\nconst {load, create, printFilters} = require('law')\n\n// files from the sample app\nconst serviceRoot = join(__dirname, '../sample/app/domain/auth/services')\nconst jargon = require('../sample/app/domain/auth/jargon')\nconst policy = require('../sample/app/domain/auth/policy')\n\n// load recurses through subdirectories and tries to\n// load any js files it finds\nconst services = load(serviceRoot)\n\n// services is just an object with {serviceName: serviceFn}\nconst services = create({services, jargon, policy})\nconsole.debug(\"I am the law:\", printFilters(services))\n```\n\nOutput:\n```txt\n{ dashboard: [ 'filters/isLoggedIn', 'filters/setIsOnline', 'dashboard' ],\n  'filters/isLoggedIn':\n   [ 'sessionId.exists',\n     'sessionId.isValid(SessionId)',\n     'filters/isLoggedIn' ],\n  'filters/setIsOnline': [ 'filters/setIsOnline' ],\n  getRole: [ 'sessionId.exists', 'sessionId.isValid(SessionId)', 'getRole' ],\n  login: [ 'login' ] }\n```\n\nNow if you want to expose these via HTTP, you can use our [law-connect](https://github.com/torchlightsoftware/law-connect) plugin.  If you're using gRPC, websockets, or some other protocol, it should be just a few lines of code to create an adapter.  Let us know if you make an adapter for a new protocol and we'll link to it here!\n\n## Further Reading\n\n[Error Codes](docs/errors.md)\n\n## Credit/Inspiration\n\nOur approach to policies was inspired by the filter lifecycle from Ruby on Rails.  The argument validations take some ideas from Design By Contract, e.g. preconditions.  Applying validators to default names was suggested by @JosephJNK.  I am interested to see if this will be conducive to creating a 'ubiquitous language' as described by Eric Evans in Domain Driven Design.\n\nMany thanks to @wearefractal (@amurray, @contra), @JosephJNK, and @uberscientist for conversations and collaboration on application design with functional and declarative programming.\n\n## The Fine Print\n\n(MIT License)\n\nCopyright (c) 2019 Torchlight Software <info@torchlightsoftware.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"email":"b@tlsft.com","name":"tlsft"}],"time":{"modified":"2022-08-31T23:08:47.411Z","created":"2013-03-14T19:55:41.197Z","0.0.13":"2013-03-14T19:55:42.378Z","0.1.0":"2013-07-17T20:12:22.508Z","0.1.1":"2013-09-18T20:04:32.949Z","0.1.2":"2013-09-18T20:17:04.402Z","0.2.0":"2013-09-22T02:07:01.772Z","0.2.1":"2013-09-22T02:10:52.968Z","0.2.3":"2013-10-04T17:30:13.277Z","0.2.4":"2013-10-11T02:46:31.600Z","0.2.5":"2013-10-21T18:48:44.304Z","0.2.6":"2014-03-23T22:36:06.135Z","0.2.7":"2014-08-21T07:19:41.646Z","1.0.0":"2019-01-22T03:50:35.534Z","1.0.1":"2019-01-22T03:51:52.582Z","1.0.2":"2019-01-22T05:40:32.120Z","1.1.0":"2019-01-22T09:07:13.851Z","1.1.1":"2019-01-22T23:39:15.587Z","1.2.0":"2019-04-07T02:42:46.993Z"},"author":{"name":"Torchlight Software","email":"info@torchlightsoftware.com"},"repository":{"type":"git","url":"git://github.com/TorchlightSoftware/law.git"},"homepage":"http://github.com/TorchlightSoftware/law","bugs":{"url":"https://github.com/TorchlightSoftware/law/issues"},"readmeFilename":"README.md"}