{"_id":"@arcteryx/js-feature-flags","_rev":"17-de2ffceff8b9dedaf44aca707176c611","name":"@arcteryx/js-feature-flags","dist-tags":{"latest":"0.4.0","alpha":"0.4.0-gamma.0"},"versions":{"0.1.0":{"name":"@arcteryx/js-feature-flags","version":"0.1.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"8a72275272954b0e160892d49aa5e61591d6a93b","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.1.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-Wb/P2Y4dDNcoYkSybXTJCHnV5NT6LoYJOg50b8eAwrk58iMKSlt4DxRcLcvsSJB/PMeMRzLU6nkcrp4MjMbPRQ==","shasum":"4d65857105b511246fbcdec47102c614a6c8bb8d","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.1.0.tgz","fileCount":11,"unpackedSize":19268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZiRdCRA9TVsSAnZWagAAFj0QAI/7KQNQRwQ9j064tyLn\ngVR8pH0k4jJYsx+OpCzTHYaK5xsWRyO1GuKXE83OsN1e9e/eNEeWDF2mSw+u\n7agyus6IFauZeRtsYu5ADlZ+fSFZhr96iJisIeClWuv+/sY5fA6a0l39DMlx\naAk3w/dWWnM45BfBn8Bt/rVnPNmNfIg7kGf00Wc3iBPGEejCSUDoOtjmyPqr\nCAaSQduwbRsXao1aa4wxH22z+r9ylDCsqM5udwZcHljuyorGlYbWH2u3S4b1\n+HDQjMJ9Zr+4CQDqvwmHyVXLRuCd0RWFUNynkK1/jhu2dMN+dRoFV1eJC0LZ\ntSateJiHTq6F48KkGmb73uXD9Ev/ApzpRQ/8FxnUAl+HsTJ5pUBNq42EUPZe\n6O8m/vTFf6fp3m9l1PFEELu9mCp+kdbqGMDJSpIngwbknD5G1g8X/HPoHY6R\nldWiUrnTgEBpI9IwoXLM4KjEYdlaveYNOXF0wRdQFf+uBvSoxdFHK9hoAEBM\nRx6e31j7TOj9q6TZplmsE7FkV6RhcKxBQ9Q+sq4PxwMrv5TGrWXc4McTLpbb\nlsTssgu3wlQt7XPKtJoSO03k/4X+WtwDNVSmUpPwbM7HXqxMJiqnktRoevsD\nFYT3egmuaSkVDtCqwZZE/HQkWN+g/U1G9ZbywiKy37nL3Zdu6lsPP36LGH69\n4qPF\r\n=YNjk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3l5HYBdmHYo+A//CmQnOe/8SAxUTOco8aFvcQ9RnZ1gIgWn+7H9OrFzE/zeL/+ZhEaMTTNc5TBKmlNYtBqBn1rHk="}]},"_npmUser":{"name":"alex.sutcliffe","email":"alex.sutcliffe@arcteryx.com"},"directories":{},"maintainers":[{"name":"housser","email":"john@housser.ca"},{"name":"alex.sutcliffe","email":"alex.sutcliffe@arcteryx.com"},{"name":"john-housser","email":"john.housser@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"arcmodal","email":"morgan.dalman@arcteryx.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"},{"name":"happyelephant","email":"alachkovics@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.1.0_1617306717195_0.6499965698439816"},"_hasShrinkwrap":false},"0.1.1":{"name":"@arcteryx/js-feature-flags","version":"0.1.1","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"5dc17a0ee52a480cb23796b60fd21ab51b60b228","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.1.1","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-6rPVHpGCjAOOedee8tHteqKWaGmlW88XbXR6y4vSw1tNcejtJFGUQ/j9oBh2FIOKHuZTtCPKhsG+r2KT3NOBZQ==","shasum":"35b001e9e76636ecb82f38fb3f18aa554b64cda4","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.1.1.tgz","fileCount":11,"unpackedSize":26900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnZ4gCRA9TVsSAnZWagAASP4P/io6QXHgUBMcb8EeKsHo\nCSMv6ogzyUTwiEvdt2hVb2QUoU2v+3KKl35Toz89bmxaSZHYDiyg+/Fw2KI6\nQQwIjooufTAw2vTQ4rewDK60b9qlFHSYH+XAP4psXt1dPW+fGwIttTkcreNV\ni//AaLIEHOC3E1wxnjF8sPOwI6vJqjXyn3mZta+4+84/yjlnXpg+xgNpifBr\nQxPijhu9fRZ7nEETCFUz7mz2oJRp0WxJ58hD927ZQgWbfwKqTxgZ+gWJLKTa\n+tFb46HkWxVJlVF3f89FWRs1/vqvqM5EdWr6/WNSIxiO4zmq1wqcGGX2GHa9\ny3vyzdO5/wXaTVknFyt1u9JDPYKTAKXq+qNQe864h8jRX2D58ZnVabT2o2SY\n1ABNydWbaSyVTkL5mwzxz2TYk7jt/yZ4BME0ft8dO3bD4ozXFsdWNMAYXLOw\nT1JiKVf5XwGqEoKjL9VR1dlJIFN4Ln1raTa5jVEecoMqmi1tp8+F4N5SUzc1\nm2edmFdajfVUXlgJ6lO+2tBQpW9d4DySZUFD7GYSZpZQnz8XsJrt3S7g8Xjl\nhH5IZc1BxEY+hTYpkAd4llc+QZJsjLuGc0SIPJLqQnkk8Q1Zg7Ri0LSeu/u4\nt/kfSKSffeu5YbH08uM6zVZQXDpb1XzDW40IiQoWmSyWt07KG86VkusT2BqB\nMNhm\r\n=R7Zy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICyux23bZ9E4r869KfooVfWetgVHZ9fo+DOHSaFn8ZmBAiEAnOngztQtB8txWsqeiNYOyXAf47+O1oFThnl/or+07gc="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"housser","email":"john@housser.ca"},{"name":"john-housser","email":"john.housser@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"arcmodal","email":"morgan.dalman@arcteryx.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"},{"name":"happyelephant","email":"alachkovics@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.1.1_1620942368028_0.973543641498313"},"_hasShrinkwrap":false},"0.2.0":{"name":"@arcteryx/js-feature-flags","version":"0.2.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"b4acd98bd77cc492ccd99c4e2dc2aa6692d5c4e7","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.2.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-k0l+JibY0+fgjECseMgAfGaFUkWk/6hAilahcyCG5HAews2A2XldNoWkccUvV72EH1XBsbybYKXXUoiAgYe2Bw==","shasum":"0cbc0b17af50eac73d611eb0b991f04b7eb3a12b","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.2.0.tgz","fileCount":11,"unpackedSize":32687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrpTGCRA9TVsSAnZWagAAy7EQAJ7D3PzWgzqALhSk/vYc\nHyg4uVDV3YF/Rsh76aVQtsRu6JT2H3dQAqDgUAQyNpr+nCENU8HzILhEm8af\nCATsJEriPd8MqYHPtRBEf/AcqcytqbNI/DzJf+6fL4b4mCMFkTvUMqRkqiBd\nr4lmL3loWBeZLgZrYw8He/pG1Y4P5NSc+YcBivHhuxdBSKgSSqAzDoty9Mxy\nHlLjF9BQIZO7xuFcFMGqfoP3rw2uvVB9xWJhpDK3MLTTV8Hdppf5YU7l9EEI\n0gmBSL/4Hresmz/HOmOcTXC1M9tImhCTVyuvu2b24arxUz9I1tcP/EAgu3BR\ne+TZVLB+5KjVE20qh/cKHl96mTE90AzzbkdwZ4ZlUCn4KA0/YrVIKmPJyJUk\nFu8RgmT6ACVYiHlziNH3x7HxCNQ5vK9EAqYA1HqEO8QG2UW51KAPkINAubsA\n740G1zz4gSRaABiOqqxp66rB9ukYQyc3eQmcNXqU2AFh975pxperKM4CaE7V\n0lznyz/5v1iMZag7z/qTYbIuiGEaLbM8z3JkwXrPxfNM5Po+cY/H16zA0B6z\nWryTH8YN6BcVoEV1nhaUjfTtoH7Jck9pAfHGfF0oclyo+sEJDgAHybHbgCRI\ne9JwdV3zWIOo4BKfLIqTIqGhdFSFUn1QHRbOVIdkftCAi8dXvL8eeA/PDTpt\nHu8/\r\n=rt3R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHJzbbzcJrr0VCa9kt6lzVDmylnQ/NBNJX/cttL+Z9GzAiA7wyD7LGeZFXxkb0rSaIy9X1lRdcE+srooOrDI0q+Lqg=="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"housser","email":"john@housser.ca"},{"name":"john-housser","email":"john.housser@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"arcmodal","email":"morgan.dalman@arcteryx.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"},{"name":"happyelephant","email":"alachkovics@gmail.com"},{"name":"nelsonarcteryx","email":"nelson.tran@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.2.0_1638831302573_0.3112990870921464"},"_hasShrinkwrap":false},"0.2.1":{"name":"@arcteryx/js-feature-flags","version":"0.2.1","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"82643c56a9881b14242aa6764845e1ae56b658aa","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.2.1","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (linux)","dist":{"integrity":"sha512-Cjs6x1EYIOTuaiSQZ/q79/opJVZRuy5qrmoRznk8XMFyAB4OynbxMuKVQTYO2CKRScWIcPqyOSyIBV6Q4Vja2Q==","shasum":"8be5a4e53dd2171b49fee9b8d39b369f3a2eaaab","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.2.1.tgz","fileCount":11,"unpackedSize":32911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsRwKCRA9TVsSAnZWagAAx8MP/RjRGm+DR655t8Bu6U8M\njuQRvk4jewDJkMvADZilAx0LnU0BAVN8upoUDExf8UnrFqc6rFaCzq4mn1iO\noaBQrkiVmtEo2hjyJ0MbKxwowhefij0wpeKZ9koQtu4gZuGRZVrgG0TycnJG\nMFo0bbSKLQO/5lpV6BMpLa64BfqRLPJa31mqWcr06ix7LmskUNrMRyxADrWs\njzYYIS/c8rEaMIYImqBCaiSJuAhK+YwiSkSvzcKzrLlJqPFoSlZh8D5Szcrz\nYXgLegwbPTRke7Xbj3dTI5vuoq/X/FW2LeUkXhNhImc1QX82nLEuh+xSkhq+\nYFd2ofFi9BjCzUP2xHnPf9timUEyqdTDu/jRG4vOYLE93OQ7ej3KPmBtjbHH\n0a91FapVy2p0n+TMsB4KBZifCurueNteLKzoWhHTs/J2ebzx1uDO019+lEM5\nFhhNOTjs+cOEe5HoFaI1hfkZnYP1v8VuU+PKpnKOYdpXx2ImZWHBhpjggMHh\nz3ESrEU19rFonhHfUHWp8bY5b/L8jv6NJ7Y2G46QXWXN7HK2HdAG2OYwPSP7\niE9KI6A7oKpHNHfnoXDf72GSIo9FUv1mRkN+uleiVj3Yr7JlT0bZ6loI70Gp\nl7LA07fnpoWgZyRLtf/2NRNxJmZlL5pL1X4ArIspNDckADL216Ze2S0Z8AD6\n3CZy\r\n=SNFR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIXIV9UIONnUDWZ6kJxJIjV2z4c6IwtgoQYFk3wswNCAiB7Ah20dKMIK8RvTMH1/WT7og7/bRfkCZodSb/OLsSsYA=="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"housser","email":"john@housser.ca"},{"name":"john-housser","email":"john.housser@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"arcmodal","email":"morgan.dalman@arcteryx.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"},{"name":"happyelephant","email":"alachkovics@gmail.com"},{"name":"nelsonarcteryx","email":"nelson.tran@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.2.1_1638997001824_0.9418501913108599"},"_hasShrinkwrap":false},"0.3.0":{"name":"@arcteryx/js-feature-flags","version":"0.3.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"ec3795a7d5bb844c4d9931d9f32cf1416d09e081","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.3.0","_nodeVersion":"16.17.1","_npmVersion":"lerna/6.0.3/node@v16.17.1+x64 (darwin)","dist":{"integrity":"sha512-IxpFyClBXP5eLMI7HLEZ6HCRPS/LMJokBmn5XyYC67sYcl+zTdY44Ir8Iix9fMTRRWhhoGjQEodiSBfR6rg3eg==","shasum":"1a7dc0108cfb019d224f662b3a87e840fab026ba","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.3.0.tgz","fileCount":10,"unpackedSize":32472,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAcbYItKOLwvpjqVyHtOGghr3cuZ3m40mQ5JYZ4nw56AIhAIEBvOQ5Wiz9y9/GDDutCDq3nV38P/dew5DWmWi5Ctsv"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjcz9RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDMA/7B56fC4avj7MS0XXKFaP58W+FuWmYOTG8QDMp4pIUa6xar865\r\nzDuFf3P7l69K6lVtNw1wqA2zFAYAkofEvsi7daDLF6ubnlvUdgJRW2VC1HqJ\r\ncRrg5YcjoJL62WoDPPG2G0se2Ols09ryemZoACI+xYkq+wES2UTTf5fuPZGu\r\n7co6Bu8sy0fIqnTbpytlJ+HFBhC2hEaUljUlUSNplCig/TuEad0RdHYnzLdh\r\nIN/zyBGVMWTI12DqB/p2m0bBuNmwyRKfmvW4V12tc5gpg12Q/FCcra3zLae/\r\nRX5tL9bJx8BSODhK+9vpf3oEd+ER8x1S/rMBhU5xMuFqwt0HQokG8Kk4funz\r\nW/N4aWR/gfodEpzr/zJ7IP9fqRKG5J/R/3vlSQV0Dkwg/wivnqDfNGEPMd0b\r\nRv0I0Jjz3tSPwqvtFVWT0ZmRoZwNooXwxGB1CqULUV1jUINLaYNqGCygkUpG\r\nPTWgT7IhydOFW1XYJ/AFvaP0O7l0pywuDXDNDGL+viMlVhEs8ORZYM4Yhew0\r\nmD4me9Bo4v66jvO4d7/vCNJAJJsI4ZH+Cth2DLaG8sqI/cOP2qmNQNg32Tg0\r\nzIKdgMckx97r/CUcQY1pUPnscUs0QGOReRJ6U51wkXzZt6/SUq5aAwXAW4r/\r\nhNgGwcf43Zfu3ttfKVzE6SaVRUiGGQEGqTs=\r\n=sXsc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"},{"name":"happyelephant","email":"alachkovics@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.3.0_1668497233762_0.8680285839407018"},"_hasShrinkwrap":false},"0.3.1-alpha.0":{"name":"@arcteryx/js-feature-flags","version":"0.3.1-alpha.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"4f15ba8d5658656d9258fed37b749d2bfe63a9a2","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.3.1-alpha.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.0.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-Mp3uS8OyOnjmtZrEwZrH1vzuDpWQaEsktCgWc5aPvELa5H3o9gcn8OqWtbYqzS9+chxcSeaoCtBvi1DKdc7zDw==","shasum":"84f18713a00c7db5b2f36771af96a2c4b1971ac6","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.3.1-alpha.0.tgz","fileCount":10,"unpackedSize":30906,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjtfCDxnWHdXx73gKh8k14FTwV+KXXX6NsEU3n9NnaDAIhAPcvcCwcPfhDseKDgI4eH6wdHvNeKENHqyXHsF6ZsmKZ"}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.3.1-alpha.0_1704927819533_0.2635514898532141"},"_hasShrinkwrap":false},"0.4.0-alpha.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0-alpha.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"62220ec46c7009487fa7953207a575eac9c02bb5","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0-alpha.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.0.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-eRYeOntMbF2zg9xJak+boXP/F2UMIOKajODtJJMrA0huGCWBYCFuzbSN1y3VhbEr394CKSbzmnWa0IcLaJypMQ==","shasum":"da1e331bc998a2ba7f5595d33f27c705df747c4e","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0-alpha.0.tgz","fileCount":10,"unpackedSize":30939,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWODdAGSHKBKW3/pieU9TJVfGFoegt6eDwoJFyLKDMZwIhAKB4FfJzxc5SvtmyD2ZVoJuuF2Ak7rEQjteK6Wefo7cJ"}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0-alpha.0_1706910105926_0.3433672611124221"},"_hasShrinkwrap":false},"0.4.0-test.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0-test.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"bd85fc01cd3cd7b5b81f7d35889beec1d0dc2fe2","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0-test.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.1.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-GeZ4YlSS/T9bRQYFex36a8FsQfbyeRyi/K+7qfP2I9L7zxzxU/WTaSo+FA2pMGcd64M6ImzkLZiYyVKbMoBXEw==","shasum":"32fea0aa5e2a2cb7a6ea001ed4be73a58220c7e6","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0-test.0.tgz","fileCount":16,"unpackedSize":36315,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2shlyhXsQRw17ME3R1lBaQBHNw2QYLU1OBEk/VPs+bwIhANpudeEd2xrqIrrNd4LP5hFGkj+wB3GInlto+fBKHAX1"}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0-test.0_1707169150685_0.9020374942751854"},"_hasShrinkwrap":false},"0.4.0-ts.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0-ts.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"13d8c9849a5ac991f6e6ee607ca507d2f77a4852","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0-ts.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.1.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-JfUIzKjvDov4n7Cr4imPn7ecI4F5m3J76sgqaYB0UJC2c5djdfN0nc5FkpSKiSnb3s42cMEz67pkN5mDhjQ0+Q==","shasum":"9c2db36854ce28bf5cad328603deba24cc33bd78","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0-ts.0.tgz","fileCount":16,"unpackedSize":36313,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0nn7vXih83le14vabvxR1kdcl2BsCtvzdl/MlPy9hOwIgQj/L3ltSFa6qPRL2dc8hcfxNFTig7agdK45VYPauSlQ="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0-ts.0_1707174775681_0.45068163889870805"},"_hasShrinkwrap":false},"0.4.0-ts2.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0-ts2.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"854e211946ce6427397811e7a05779d3d6fe909d","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0-ts2.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.1.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-vxu+r1i8reQ+fhK5wOgRSdqDj1PaRAopUiplBUNuMglZHLVoHUOKSzlgd6i/KhG+BCtOdwnai8HOR/RriGf1sA==","shasum":"244c143007f1837e29c2b37f37a00ce09d2f1163","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0-ts2.0.tgz","fileCount":16,"unpackedSize":36314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAixXEDJNzRVS8tw6PzsQbv33TDoBDIzkxRWp8AzPKXNAiAXgVuI0my20getFwO7h0UYiZsFfpnaebttjCnPstC0iw=="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0-ts2.0_1707243638099_0.40120606143943816"},"_hasShrinkwrap":false},"0.4.0-gamma.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0-gamma.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"1a7a6e1474fd63c25d6c87ac76803343ea10145c","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0-gamma.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.1.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-+xPQ8eLzYJmD8oN7NfJO6mrmR4mhZIG/At85ZdB9uKCQ/6j1EhyW4C6Sxzw40XCk4Wl3dsDwo/1iFWTaVxu/3g==","shasum":"066bcb78a0de6d6d655053996b70e3d891397461","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0-gamma.0.tgz","fileCount":16,"unpackedSize":36367,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsRUJBlHXjqtQwSMxh6iEvitNt/t4ed++Ny9b701WBGAiEAt3EL2l20cCb92846Ipe8CNG7BpWRuVMXjgn8kQAOpYI="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0-gamma.0_1707776948497_0.12698832319549025"},"_hasShrinkwrap":false},"0.4.0":{"name":"@arcteryx/js-feature-flags","version":"0.4.0","source":"src/index.js","main":"dist/cjs/index.js","umd:main":"dist/umd/index.js","module":"dist/es/index.js","types":"dist/es/index.d.ts","scripts":{"build":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js","start":"../node_modules/.bin/rollup -c ../scripts/rollup.config.js -w","test":"../node_modules/.bin/jest --coverage"},"license":"ISC","gitHead":"7b3b8a274968f39c5cf564cab85ae4508e484682","description":"## Install it:","_id":"@arcteryx/js-feature-flags@0.4.0","_nodeVersion":"16.20.2","_npmVersion":"lerna/8.1.2/node@v16.20.2+x64 (linux)","dist":{"integrity":"sha512-cefLgqNl7viZudbO687Zh5UQTBDJF4W5pk00xCCWlbISvsCmMoS3MhpNLrkedDIDtQoQ0/3tDUtAYWIWwM8emw==","shasum":"aa8e2a415486d079470a6b3cff54ca48dbe48f04","tarball":"https://registry.npmjs.org/@arcteryx/js-feature-flags/-/js-feature-flags-0.4.0.tgz","fileCount":16,"unpackedSize":36359,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKqS+GLVOxRcu4rw4EVe8U/xYHXLcdnaOdA4leU0B0yAiBDjSimLOj0dHjDkZk8d8EODDhG6gOi6BUSpYj1N0BqtA=="}]},"_npmUser":{"name":"ronvs","email":"ron.santos@gmail.com"},"directories":{},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-feature-flags_0.4.0_1708551438751_0.8855713016587043"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-01T19:51:57.051Z","0.1.0":"2021-04-01T19:51:57.336Z","modified":"2024-02-21T21:37:19.426Z","0.1.1":"2021-05-13T21:46:08.235Z","0.2.0":"2021-12-06T22:55:02.746Z","0.2.1":"2021-12-08T20:56:42.041Z","0.3.0":"2022-11-15T07:27:13.896Z","0.3.1-alpha.0":"2024-01-10T23:03:39.722Z","0.4.0-alpha.0":"2024-02-02T21:41:46.079Z","0.4.0-test.0":"2024-02-05T21:39:10.890Z","0.4.0-ts.0":"2024-02-05T23:12:55.881Z","0.4.0-ts2.0":"2024-02-06T18:20:38.286Z","0.4.0-gamma.0":"2024-02-12T22:29:08.656Z","0.4.0":"2024-02-21T21:37:18.944Z"},"maintainers":[{"name":"justinohalloran","email":"justin.ohalloran@arcteryx.com"},{"name":"ronvs","email":"ron.santos@gmail.com"},{"name":"jamiearc","email":"jamie.chong@arcteryx.com"}],"description":"## Install it:","license":"ISC","readme":"# Arc'teryx Feature Flags\n\n## Install it:\n\n```\nnpm install @arcteryx/js-feature-flags\n```\n\n## Overview\n\nThis package helps your application implement \"Feature Flags\" so you can enable/disable specific features or blocks of code. This allows developers to release code to master/production without impacting existing user experience.\n\nBy default Feature Flags are managed by Cookie values being `\"true\"`. But you have the ability to customize this with `setCustomLookupFunction`.\n\nNote that to indicate that the feature is enabled, this library assumes that the value returned by the feature lookup function will be `\"true\"`.\n\n## Usage:\n\nIn your application create a new file that will be used to export your application Feature Flags. Optionally export multiple \"feature sets\", if you want to group features for different pages in your application for example.\n\n```\n// lib/features.js  (for example)\n\nimport FeatureFlags from \"@arcteryx/js-feature-flags\";\n\nexport const FeatureSet1 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n\nexport const FeatureSet2 = FeatureFlags.define([\n  \"myFeature1\",\n  \"myFeature2\"\n]);\n```\n\nElsewhere in your application, test if the feature is enabled:\n\n```\nimport { FeatureSet1 } from \"./lib/features\";\n\nif (FeatureSet1.myFeature1()) {\n  // Do the feature!\n} else {\n  // Maybe do something else\n}\n```\n\nThe features you define directly correspond to a `key` or multiple `keys`. You can optionally map a different `key` to the feature. By default the `key` corresponds to a Cookie Key. When using multiple `keys` can optionally set to `require` to \"all\" which would require all of the `keys` for that feature to be true. By default `require` is \"any\".\n\n```\n// Map a different key in your definition\nFeatureFlags.define([\n  \"myFeature1\",\n  { name: \"myFeature2\", key: \"usesCustomCookieKey\" },\n  { name: \"myFeature3\", key: [\"enableFeature3\", \"enableAllFeatures\"] },\n  { name: \"myFeature4\", key: [\"enableFeature4\", \"enableAll\"], require: \"all\" }\n]);\n\n// enable myFeature1\ndocument.cookie = \"myFeature1=true\";\n\n// enable myFeature2\ndocument.cookie = \"usesCustomCookieKey=true\";\n\n// enable myFeature3\ndocument.cookie = \"enableFeature3=true\";\n  or\ndocument.cookie = \"enableAllFeatures=true\";\n\n// enable myFeature4\ndocument.cookie = \"myFeature4=true;enableAll=true;\";\n```\n\n## Server applications\n\nTo access Cookies on the server, you must use `setCustomLookupFunction` because the default implementation uses `document.cookie` as the feature store and that is not available on the server. Most likely you'll continue to use Cookies to manage your store of features, but you may handle this however you wish. In a NextJS application, set this up in `getServerSideProps`.\n\n```\nimport { Cookies } from \"cookies\";\nimport { FeatureSet1 } from \"./lib/features\";\n\nexport async function getServerSideProps(ctx) {\n  const { req, res } = ctx;\n\n  // https://www.npmjs.com/package/cookies  but you could use anything\n  const cookies = new Cookies(req, res);\n\n  FeatureSet1.setCustomLookupFunction(key => cookies.get(key));\n\n  if (FeatureSet1.myFeature1()) {\n    // Do the feature!\n  }\n}\n```\n","readmeFilename":"README.md"}