{"_id":"one-mutation","_rev":"6-0964b6c7b75d7ae82df070aba96d256d","name":"one-mutation","dist-tags":{"latest":"3.0.1"},"versions":{"0.0.0":{"name":"one-mutation","version":"0.0.0","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"license":"MIT","_id":"one-mutation@0.0.0","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"homepage":"https://github.com/fregante/one-mutation#readme","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","unicorn/import-index":"off","import/no-useless-path-segments":"off"}},"dist":{"shasum":"ee54023a835aa7f4bde47045cd27b53df38df66c","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-0.0.0.tgz","fileCount":5,"integrity":"sha512-fVw3ZzO2Pn31DX+OIR/dIA99Zq4gyzqDcBki3Ogu8dGgFOcEJApMcCnXpWx/gRjDmOv6wsvMEJ2glTkdj0KoJg==","signatures":[{"sig":"MEQCIGtqrC1WTT/xpdFIQgAceN9uVojH4I+kpAtWjNoZJIbTAiALBUfx1nA9VR2zUseaT+xIG6oSi9/2nB62msHnfZkYgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuhJwCRA9TVsSAnZWagAASL8P/2gmK2LyfsosB0MzG5Mp\n0jfI/RXYW+5zrcZ3+cwwgbZ0m/XGw06Lol1/n701rZzttb5gh2QzlUcEteWd\nmHjCIi08m2QY0ZUsQ+ZNfXcnPIbK1j03NsQQRP4qbRp8oGLbCOBoygRp0dbd\nYzW3MAh/VI9iPqHZQci9OJQxJek3aM0vJIQp3YRG4wrvjpnGNxu3T/bCqLgz\noVPCO20mneZkuJuoTFxLkkmXiKRnMtR3KkSgxBVY2+aUrtC74uT/Ptgojt9B\nV6MA3ypTk58HTS/gaMZLN0tmfqxLv5oLmXO2ksJsVb4BvztTfqz+tL7HdLgT\nWqaYGSydz60BNElAWF9wqWTg7V+kQj3y7tLgLH6txTdyNrKmQ5c3kEn9XekV\nPQPKCUMaP/lqnorD/xI4eAIk+J/SDmIvd+rV6R8mQRKkZ32IOJQM1UUVGSCr\nNdvLCxsNOJJVNouzFV3knHCIZDGsLsAc94vZ4SPMvfI58+A+FmdKpZeiK+Ms\nQFWrkZ7mlcfyb/viW6YrscBbiZydYH3jvdxP+aQOTjTVINU/16O3NljWcfVD\noj738rZWSoSTB9INiyDz0BXVs8upNsfHdM30nitesIDbdqJfymrDxaaDv9PF\nPaMywDkqknkEOm6cO2X0gPdDl4qN37qyjtp0PU//IoW50dUsdPpNlBLcUj6o\n+ock\r\n=Kk73\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","module":"index.js","gitHead":"9d72dbda9819055c2d4337dd156945eb96ff898c","scripts":{"test":"tsc && xo && ava","build":"tsc","watch":"run-p --silent watch:*","prepack":"tsc --sourceMap false","watch:test":"ava --watch","watch:build":"tsc --watch"},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"repository":{"url":"git+https://github.com/fregante/one-mutation.git","type":"git"},"_npmVersion":"6.14.5","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","directories":{},"_nodeVersion":"14.4.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.35.0","ava":"^3.13.0","delay":"^4.4.0","jsdom":"^16.4.0","typescript":"^4.1.2","npm-run-all":"^4.1.5","@sindresorhus/tsconfig":"^0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/one-mutation_0.0.0_1606029935582_0.43232342395567214","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"one-mutation","version":"1.0.0","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"license":"MIT","_id":"one-mutation@1.0.0","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"homepage":"https://github.com/fregante/one-mutation#readme","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","unicorn/import-index":"off","import/no-useless-path-segments":"off"}},"dist":{"shasum":"2cdb6786577a0048a0461acd767cc932ce87c5ee","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-1.0.0.tgz","fileCount":5,"integrity":"sha512-H7GVClDmPaz6EB16fezxS+Q17HSDIhEDiIFA902wzFGnsbirfLFrPx7QTTlWBcJtjOfWnek7vPPGQIkf9+mV4g==","signatures":[{"sig":"MEQCICm10Kabo+AyanzbhFk493l2aLZ9OCkZrlu+vZan+OcgAiBHzc6gupA7BD7ESqqNcEXI63HeCZyEda8xWQNSul87aA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuhN6CRA9TVsSAnZWagAA51wQAKKcwSRV+knnAa2giOKr\njy8LBD36HsIAdcIAm55FZogvOMq4LPYiezb4PY2RMEYnvEWOgJ4ShOlo1wlb\n2XdbPlrVpY/7x7ShcwESBgCVE3Z538KbzsWyDvYfcEBu4BWlMHcEom/2y9+f\n9XnIRcuc8SwlciNhXqqW3q3jAWKIPGmMciZZTgYw5IMq/eUP7oW8y61srTRD\ndLYNRLJARQT5MOmFYYhpLSrv1K+IntWoactYqsaoKwBwos86erUsq6LvSdqt\nMS8KUsXq2puTDuTzFhk9P2tB3z76BLi4TQEoUPPW5mT6D+NPc6RF0vb512pg\n6Poh0qyLTn+/m6G5oPDrf1oEXWbxtfClRtL7CNU46Rxxca9/RIpzMWhl+slp\n5vrvdqfAeChOueQqKV7cWxdw89O/PZ+jEgs+t/+uIwGSQ+JXckW9OUAzhVsq\nwbCgB1gVmsojMzn3eJCLIeJ03QEw2iTAz5k2+oxCnR0kmUdllK24+YoQ93b7\nkLs2+8KtekUnFQ7G95TZGmrjiLqponL2ZfrweFLWQZvCvtgfv/+r4UXzzCaF\nOsUbJ+cZR4XDzzhjYjZ3j4JTXZqQRH75ZZ+0ucv2kv2k1pqyDCIRECI2ndEF\n0VWB7zZ+efd04lmxYvq9t2l2Msn3DFzcTJ3m4vdTonpxqM+9tB4LazU5LP+w\ndHfy\r\n=c4tM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","types":"./index.d.ts","module":"index.js","gitHead":"62466f0d246c92311fe0816f145985055bc3ae55","scripts":{"test":"tsc && xo && ava","build":"tsc","watch":"run-p --silent watch:*","prepack":"tsc --sourceMap false","watch:test":"ava --watch","watch:build":"tsc --watch"},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"repository":{"url":"git+https://github.com/fregante/one-mutation.git","type":"git"},"_npmVersion":"6.14.5","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","directories":{},"_nodeVersion":"14.4.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.35.0","ava":"^3.13.0","delay":"^4.4.0","jsdom":"^16.4.0","typescript":"^4.1.2","npm-run-all":"^4.1.5","@sindresorhus/tsconfig":"^0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/one-mutation_1.0.0_1606030201899_0.5311530101578763","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"one-mutation","version":"2.0.0","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"license":"MIT","_id":"one-mutation@2.0.0","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"homepage":"https://github.com/fregante/one-mutation#readme","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","unicorn/import-index":"off","import/no-useless-path-segments":"off"}},"dist":{"shasum":"e2882b46097f354e4595535fe24a427b5464ca0b","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-2.0.0.tgz","fileCount":5,"integrity":"sha512-uxZBzkaGhKWy9bdj1peVBhgCP4abF1Rss6wIVzBi1VoaTVEMmFc3pp/hhkVKr5VL5SsmLanBy8i2mmTGQreVPQ==","signatures":[{"sig":"MEUCIETPEZRB326ZzPfG8ixzSp1F0gZd0OmLCxfMunmpPuYXAiEAzOFhPPYeavAJmJfDqY+6p8pWaHaTH8U1FilCq+O+cxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBL1aCRA9TVsSAnZWagAA/H8QAIUO3dTaw/0iSUCZb+km\nxaUj/G43qZv7ywPqn8mxV6n53pC5+AOJ0NHdyGZWTh0HW0hmiGdhC9QY3Tbb\n/9TahPEpStPPPGqmu825oVDmzvsxHN6Dx7mUMu6CGaSDVSuGYG7HSDf5+6Lv\nyb3goQfXPhQrL2NKe1szc41rblzgKXgp1QxG7rx4zi3bcxX8m+hrUNuG6rZE\nvMeRGndhT3X7yR2juFJu+mr6oeLFRD4K8whwCUxVLzhXBxDuDg8HKyY3CMaB\nP1lbabS5p1PzKpgYzNf4lgQkFRoEeSg/gi7N22U8+Dm2803UH7ATF9hTE4Ii\neCZF7mAYFNZeYhid5COBEfk/TNiv+1CJMPF+b7waxFBhlkSfKjWaKH+ff50p\nJVwm95qQdfUsLjS+7rSLZB/KJ8lJL3v+O31IN9pzao4CZrHI7mYy9PHO+dyZ\n1MFxuVnH7NNW0i2DOnJkrpdQugo0kHC8+eyrP9zyyily36oVx0u9CXV+R4j1\nwQqqkX1DDFGTQr4aJxm4LxJ4uJ0nCfhABEG17h1r/TqaY1hGjR6DhF8ghWSJ\nD9ea7W/FhjjPRWm7J/m8sr3yvwgxOiH091CopFvxDjr7tsP3/ctFT1FHS20T\nLFZkEgLd+8qzgmHDNeSJveWwrxbQ28igfhJ99x/y2r5MrZo0uFAdqfXuUdxj\nSCg0\r\n=L0p/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","type":"module","types":"./index.d.ts","module":"index.js","gitHead":"92461616c564055852ae3f72cbcff3ccdb38092f","scripts":{"test":"tsc && xo && ava","build":"tsc","watch":"run-p --silent watch:*","prepack":"tsc --sourceMap false","watch:test":"ava --watch","watch:build":"tsc --watch"},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"repository":{"url":"git+https://github.com/fregante/one-mutation.git","type":"git"},"_npmVersion":"7.0.8","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","directories":{},"_nodeVersion":"15.2.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.35.0","ava":"^3.13.0","delay":"^4.4.0","jsdom":"^16.4.0","typescript":"^4.1.2","npm-run-all":"^4.1.5","@sindresorhus/tsconfig":"^0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/one-mutation_2.0.0_1610923353351_0.255508875046373","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"one-mutation","version":"2.1.0","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"license":"MIT","_id":"one-mutation@2.1.0","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"homepage":"https://github.com/fregante/one-mutation#readme","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","unicorn/import-index":"off","import/no-useless-path-segments":"off"}},"dist":{"shasum":"4d6524a4fbd1a0a3a668701bee545adcfae566c7","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-2.1.0.tgz","fileCount":5,"integrity":"sha512-iRdYEWwcATme2qXrQ0dFXmE5ICqEEKqIUb4imFF/jCJer/PKKwP1L755MVzmbjSIxSQZ6HNcvMSwOUnhmYSoEw==","signatures":[{"sig":"MEUCIGGWOdAmmFy+xoKRJbZ03naO+MIalPGkJtcw69s7pk/nAiEAvOI8BZRTsOHB9B4ecXOsFWCtN4PygCha8h0jduOMyNI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCgHHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSyw//efNOstJDfeujEqUOq7PRWUYK5Ll76jT+fm4hkO7cN0oyvSAH\r\nNnnzk+nXEQ+DimkdGtB9XEX5Qp+khtkE8PTur/crZxUpsw0IXPwzSl9ejzpV\r\nlM1emj/CEiSmJq3MfLcMaxm1sB/K/3ott6wx3owlwSVrVXgHIc4eoJfTL7rb\r\nL3QQxYhCpvF1LlT421I4sNiURQ/guPytCAPAJmtU+ua2+ngnBHjKHMCAqm4r\r\nHcsVPDkqfWVxucCyqU4lGij6GojTg9slM2leSZ1SwUzin1WlcQOGQDibTS7p\r\n4j/UgEq0SiKaNZAXZKGErINlolaTq0Ubs07oFGNIxWzTIRBDW9nVXYj3VtCg\r\nqKLqqq5dSYKGQ4g24b2MJuwxd5YMxYhqaqL4U4QWvwVj+Ckhk8CO0FB0apGc\r\nvdg3TMy9/5DbJB5KTvEihGQHzftvQrhPgT3gHFNwqdwqPZmmsDoMYEI3wdjA\r\nnQlgUU+PJTcKeGk94CAVkpiASIEcTt8y6I7lG0bDmzKG3azFPI93nFB8mDhm\r\nESRZyhWmYFBiydEvwbTiOuJVF6bkjBnQf6o5vOw6nuYhcGPng2gTn1semgiT\r\nU+Fj4z85jfQGIoGh3VnDRkuMPs6mnb5OuMkA+Mo6OMGaTsPpKppXoviba7WA\r\n+X9WPTQRVa57EjZ2QTUUANoH18lf67gvRTo=\r\n=8MR0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","type":"module","types":"./index.d.ts","exports":"./index.js","funding":"https://github.com/sponsors/fregante","gitHead":"4fd4194619a5fff25cada3530269363e610fa0b4","scripts":{"test":"tsc && xo && ava","build":"tsc","watch":"run-p --silent watch:*","prepack":"tsc --sourceMap false","watch:test":"ava --watch","watch:build":"tsc --watch"},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"repository":{"url":"git+https://github.com/fregante/one-mutation.git","type":"git"},"_npmVersion":"9.6.0","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","directories":{},"_nodeVersion":"18.13.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.53.1","ava":"^5.2.0","delay":"^5.0.0","jsdom":"^21.1.0","typescript":"^4.9.5","npm-run-all":"^4.1.5","@sindresorhus/tsconfig":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/one-mutation_2.1.0_1678377415418_0.7644301240335416","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"one-mutation","version":"3.0.0","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"license":"MIT","_id":"one-mutation@3.0.0","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"homepage":"https://github.com/fregante/one-mutation#readme","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","unicorn/import-index":"off","import/no-useless-path-segments":"off"}},"dist":{"shasum":"fdcc0c69facfac3d85b8f463709f42635f634962","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-3.0.0.tgz","fileCount":5,"integrity":"sha512-XQwKPm088gyoK/IGzud0j/c9gPc+slXWZI7Tpao/N4e7zYCJVlUYk4sfUvleyO66e0oj1ozlGoDa9h0RCqluvw==","signatures":[{"sig":"MEUCICTI1gThtVU8xlrq+k78XPsgAx3VKpYp/qe0QyzbVECjAiEAogUfLugQlPVEKAld9FuYTDiPSADiR4DT/14sLkIjnms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6510},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":"./index.js","funding":"https://github.com/sponsors/fregante","gitHead":"0de3b4a206a05aae3a2bbb81c6c6dcf5eb79d874","scripts":{"test":"tsc && xo && vitest run","build":"tsc","watch":"run-p --silent watch:*","prepack":"tsc --sourceMap false","watch:test":"vitest","watch:build":"tsc --watch"},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"repository":{"url":"git+https://github.com/fregante/one-mutation.git","type":"git"},"_npmVersion":"10.2.4","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","jsdom":"^24.0.0","vitest":"^1.4.0","typescript":"^5.4.3","npm-run-all":"^4.1.5","@types/jsdom":"^21.1.6","@sindresorhus/tsconfig":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/one-mutation_3.0.0_1712131941526_0.9039717846766542","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"one-mutation","version":"3.0.1","description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"repository":{"type":"git","url":"git+https://github.com/fregante/one-mutation.git"},"funding":"https://github.com/sponsors/fregante","license":"MIT","type":"module","exports":"./index.js","types":"./index.d.ts","scripts":{"build":"tsc","prepack":"tsc --sourceMap false","test":"tsc && xo && vitest run","watch":"run-p --silent watch:*","watch:build":"tsc --watch","watch:test":"vitest"},"xo":{"envs":["browser"],"rules":{"import/extensions":"off","import/no-useless-path-segments":"off","unicorn/import-index":"off"}},"devDependencies":{"@sindresorhus/tsconfig":"^5.0.0","@types/jsdom":"^21.1.6","jsdom":"^24.0.0","npm-run-all":"^4.1.5","typescript":"^5.4.3","vitest":"^1.4.0","xo":"^0.58.0"},"engines":{"node":">=18"},"_id":"one-mutation@3.0.1","gitHead":"694298eaa03a59fc5ac54d0cad15b08214bfb2d4","bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"homepage":"https://github.com/fregante/one-mutation#readme","_nodeVersion":"22.6.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CrPfahxx3y6RBJ/mEJ+SvualP9PZPHdP9uwUKQaneET67RE+2KE+1mFwFtOYhVCJ2WeivY+zFhBW2N6ELdAOKg==","shasum":"4a4b3e363d7d7b728e9811bb5e5ee12ef60f738b","tarball":"https://registry.npmjs.org/one-mutation/-/one-mutation-3.0.1.tgz","fileCount":5,"unpackedSize":6498,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICEOSpiyhm8SV13iCQZO9HMyPRh4g1pxB7FAshe8EZI9AiBB6hsvqTQDaABtqS4156CkCDCctxjwTxJwahVO1CNLfw=="}]},"_npmUser":{"name":"fregante","email":"opensource@bfred.it"},"directories":{},"maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-mutation_3.0.1_1728212703555_0.0015440253863880926"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-22T07:25:35.582Z","modified":"2024-10-06T11:05:03.994Z","0.0.0":"2020-11-22T07:25:35.799Z","1.0.0":"2020-11-22T07:30:02.036Z","2.0.0":"2021-01-17T22:42:33.512Z","2.1.0":"2023-03-09T15:56:55.640Z","3.0.0":"2024-04-03T08:12:21.708Z","3.0.1":"2024-10-06T11:05:03.845Z"},"bugs":{"url":"https://github.com/fregante/one-mutation/issues"},"license":"MIT","homepage":"https://github.com/fregante/one-mutation#readme","keywords":["mutationobserver","mutations","dom","changes","promise","onchange","added","removed","attributes","elements","notes","once","event"],"repository":{"type":"git","url":"git+https://github.com/fregante/one-mutation.git"},"description":"Observe one mutation via `MutationObserver`, then resolve a Promise.","maintainers":[{"name":"fregante","email":"opensource@bfred.it"}],"readme":"# one-mutation [![][badge-gzip]][link-bundlephobia]\n\n[badge-gzip]: https://img.shields.io/bundlephobia/minzip/one-mutation.svg?label=gzipped\n[link-bundlephobia]: https://bundlephobia.com/result?p=one-mutation\n\n> Observe one mutation via `MutationObserver`, then resolve a Promise.\n\n## Install\n\n```\nnpm install one-mutation\n```\n\n```js\n// This module is only offered as a ES Module\nimport oneMutation from 'one-mutation';\n```\n\n## Usage\n\n```js\noneMutation(document.body, {childList: true}).then(mutations => {\n\t// A text node was added!\n});\n\ndocument.body.append('Text');\n```\n\n```js\noneMutation(document.body, {\n\tchildList: true,\n\tfilter: mutations => mutations.find(mutation => {\n\t\tfor (const node of mutation.addedNodes) {\n\t\t\tif (node.textContent === 'Just me!') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t})\n}).then(mutations => {\n\t// The expected 'Just me!' node was added!\n});\n\ndocument.body.append('Text'); // Won't resolve the promise\ndocument.body.append(document.createElement('div')); // Won't resolve the promise\ndocument.body.append('Just me!'); // Now!\n```\n\n## API\n\n### oneMutation(node, options)\n\nExample:\n\nReturns a `Promise` that is fulfilled when the expected mutation is found.\n\n#### node\n\nType: `Node` <br>\nExample: `document.body`, `document.querySelector('.article-list')`\n\nThe node/element to observe. The equivalent parameter of:\n\n```JS\nnew MutationObserver(callback).observe(NODE, options)\n```\n\n#### options\n\nType: `MutationObserverInit & {filter?: FilterFunction, signal?: AbortSignal}` <br>\nExample: `{childList: true}`, `{subtree: true, filter: filterFunction}`\n\nThis matches [`MutationObserverInit`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserverInit) and adds a `filter` method and an `signal` to cancel the observation.\n\nThe equivalent parameter of:\n\n```JS\nnew MutationObserver(callback).observe(node, OPTIONS)\n```\n\n##### subtree, childList, ...\n\nRefer to the MDN [MutationObserver documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserverInit) to find the full list of properties.\n\n##### filter\n\nType: boolean-returning `function` <br>\nExample:\n\n```js\nfunction filterFunction(mutations) {\n\tfor (const mutation of mutations) {\n\t\tfor (const node of mutation.addedNodes) {\n\t\t\tif (node.textContent === 'Just me!') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nA function that will be called every time that `MutationObserver` detects a change, the equivalent parameter of:\n\n```JS\nnew MutationObserver(FILTER)\n```\n\n**But** it should only be used to return `true` or `false` so that the Promise can be resolved.\n\n##### signal\n\nType: `AbortSignal` <br>\nExample:\n\n```js\nconst timeout = AbortSignal.timeout(1000);\noneMutation(document.body, {\n\tsignal: timeout,\n\tattributes: true,\n}).then(mutations => {\n\tif (mutations.length > 0) {\n\t\tconsole.log('No changes were detected in 1 second');\n\t} else {\n\t\tconsole.log('A change was detected!');\n\t}\n});\n```\n\n## Related\n\n- [one-event](https://github.com/fregante/one-event) - Micro module to add an event listener to be executed only once.\n- [select-dom](https://github.com/fregante/select-dom) - Lightweight `querySelector`/`All` wrapper that outputs an Array.\n- [doma](https://github.com/fregante/doma) - Parse an HTML string into `DocumentFragment` or one `Element`, in a few bytes.\n- [Refined GitHub](https://github.com/sindresorhus/refined-github) - Uses this module.\n\n## License\n\nMIT © [Federico Brigante](https://fregante.com)\n","readmeFilename":"readme.md"}