{"_id":"napi-macros","_rev":"4212059","name":"napi-macros","description":"Set of utility macros to make writing N-API modules a little easier.","dist-tags":{"latest":"2.2.2"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"time":{"modified":"2026-03-04T17:06:48.000Z","created":"2018-02-23T13:38:27.582Z","2.2.2":"2022-12-27T21:29:20.282Z","2.2.1":"2022-12-27T21:28:10.952Z","2.2.0":"2022-12-27T21:18:14.859Z","2.1.1":"2022-12-14T09:33:44.157Z","2.1.0":"2022-11-04T09:37:01.650Z","2.0.0":"2019-06-20T10:03:16.862Z","1.8.2":"2018-12-13T22:56:28.149Z","1.8.1":"2018-08-31T23:50:19.537Z","1.8.0":"2018-08-31T23:38:19.262Z","1.7.0":"2018-08-08T14:20:35.856Z","1.6.0":"2018-08-06T02:04:02.618Z","1.5.0":"2018-08-05T22:35:42.971Z","1.4.1":"2018-07-23T18:32:51.259Z","1.4.0":"2018-07-13T16:22:11.503Z","1.3.0":"2018-02-25T17:14:09.207Z","1.2.0":"2018-02-25T16:06:55.636Z","1.1.0":"2018-02-23T22:57:44.869Z","1.0.0":"2018-02-23T13:38:27.582Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"versions":{"2.2.2":{"name":"napi-macros","version":"2.2.2","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"2b803162101cf1932c937512a9597a1a510f5e17","_id":"napi-macros@2.2.2","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"817fef20c3e0e40a963fbf7b37d1600bd0201044","size":4649,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.2.2.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.2.2_1672176560088_0.9081449138521442"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-27T21:29:23.296Z","publish_time":1672176560282,"_cnpm_publish_time":1672176560282},"2.2.1":{"name":"napi-macros","version":"2.2.1","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"47c8993ca2c459cc0955164b1d418585142461e2","_id":"napi-macros@2.2.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"9370eb6da42298ca17b1103da7c65ea206a860d5","size":4887,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.2.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.2.1_1672176490812_0.8143071962048041"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-27T21:28:13.982Z","publish_time":1672176490952,"_cnpm_publish_time":1672176490952},"2.2.0":{"name":"napi-macros","version":"2.2.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"b507455c5e3bfec5d08baeec05565f11a5fd5422","_id":"napi-macros@2.2.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"5bc4eeb1f5542738b84509e1f763d664f79639b6","size":4885,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.2.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.2.0_1672175894703_0.4688112019496573"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-27T21:18:24.355Z","publish_time":1672175894859,"_cnpm_publish_time":1672175894859},"2.1.1":{"name":"napi-macros","version":"2.1.1","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"9f7e9119201b8adffb5cdd947c685c7325aeba84","_id":"napi-macros@2.1.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"2405c71a375ce1325ee5fb37e767dddc71c3cf9d","size":4698,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.1.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.1.1_1671010423967_0.6841343592936155"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-14T09:40:51.810Z","publish_time":1671010424157,"_cnpm_publish_time":1671010424157},"2.1.0":{"name":"napi-macros","version":"2.1.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"080c1700648cfb449d569ff5698d017306667cfa","_id":"napi-macros@2.1.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"shasum":"d0a8bd90b65be19dd37e425386a005c694f7039d","size":4694,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.1.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.1.0_1667554621462_0.5550122174820826"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-04T09:50:47.476Z","publish_time":1667554621650,"_cnpm_publish_time":1667554621650},"2.0.0":{"name":"napi-macros","version":"2.0.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"64475122e128fc62faa4272bce7eb45fd2a2c372","_id":"napi-macros@2.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"2b6bae421e7b96eb687aa6c77a7858640670001b","size":4634,"noattachment":false,"key":"/napi-macros/-/napi-macros-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-2.0.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_2.0.0_1561024996748_0.034569275823598034"},"_hasShrinkwrap":false,"publish_time":1561024996862,"_cnpm_publish_time":1561024996862},"1.8.2":{"name":"napi-macros","version":"1.8.2","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"5be66da9438642ffafba3e655cc4fe207b075473","_id":"napi-macros@1.8.2","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"dist":{"shasum":"299265c1d8aa401351ad0675107d751228c03eda","size":4618,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.8.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.8.2.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.8.2_1544741787991_0.3908872763569584"},"_hasShrinkwrap":false,"publish_time":1544741788149,"_cnpm_publish_time":1544741788149},"1.8.1":{"name":"napi-macros","version":"1.8.1","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"a711aa5c7b86f38b4f01133328e456d1be811e74","_id":"napi-macros@1.8.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"da351d116cd317d85417f7594ce6b206508260eb","size":4617,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.8.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.8.1.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.8.1_1535759419429_0.03523028539064854"},"_hasShrinkwrap":false,"publish_time":1535759419537,"_cnpm_publish_time":1535759419537},"1.8.0":{"name":"napi-macros","version":"1.8.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"0e9d937d8d81ee50d5f9ec4153739d675ca838c0","_id":"napi-macros@1.8.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"57c51fc9f7d26f474afacb0d4d6f53954ba7a8ef","size":4601,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.8.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.8.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.8.0_1535758698892_0.8073620679980262"},"_hasShrinkwrap":false,"publish_time":1535758699262,"_cnpm_publish_time":1535758699262},"1.7.0":{"name":"napi-macros","version":"1.7.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"1eedb3a4f9794b9865212f72da97089d7d8b73ea","_id":"napi-macros@1.7.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"dist":{"shasum":"6d556b1616f694f561b048211a9d8d1941700814","size":4463,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.7.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.7.0_1533738035764_0.5630497940549855"},"_hasShrinkwrap":false,"publish_time":1533738035856,"_cnpm_publish_time":1533738035856},"1.6.0":{"name":"napi-macros","version":"1.6.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"7ed01cb6dc4312ba65683eb442f01c7efa7eca6d","_id":"napi-macros@1.6.0","_npmVersion":"6.1.0","_nodeVersion":"10.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"16eea273e0ef59a0f19d6fe22f5dca5ba287af2f","size":4289,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.6.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.6.0_1533521042528_0.10752735120310808"},"_hasShrinkwrap":false,"publish_time":1533521042618,"_cnpm_publish_time":1533521042618},"1.5.0":{"name":"napi-macros","version":"1.5.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"da4aff3c2e6424aa64764845af107ea092566ff5","_id":"napi-macros@1.5.0","_npmVersion":"6.1.0","_nodeVersion":"10.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"cddb1a27d8587bab2cede27318ad5203e9530ff2","size":4109,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.5.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.5.0_1533508542818_0.8914570115952669"},"_hasShrinkwrap":false,"publish_time":1533508542971,"_cnpm_publish_time":1533508542971},"1.4.1":{"name":"napi-macros","version":"1.4.1","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"47afdadedb13d860eff588735bc8c909994cec81","_id":"napi-macros@1.4.1","_npmVersion":"6.1.0","_nodeVersion":"10.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"cba103bda95e09f5c5b0e43bdba3d72dd65b19c4","size":3799,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.4.1.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.4.1_1532370771127_0.5435785227594478"},"_hasShrinkwrap":false,"publish_time":1532370771259,"_cnpm_publish_time":1532370771259},"1.4.0":{"name":"napi-macros","version":"1.4.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"d01adf655830fb2c94afdbac7078520584036cb7","_id":"napi-macros@1.4.0","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"a21fdbc7a8e5a3cb2cbbd74c4807ea3501103341","size":3809,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.4.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.4.0_1531498931449_0.06552752179985122"},"_hasShrinkwrap":false,"publish_time":1531498931503,"_cnpm_publish_time":1531498931503},"1.3.0":{"name":"napi-macros","version":"1.3.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"101783c13318f8291605801448e2cc99c36b592c","_id":"napi-macros@1.3.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"dca489a65ab1d464120f9d5d745ce45a344056ab","size":3689,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.3.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.3.0_1519578849162_0.576481201963166"},"_hasShrinkwrap":false,"publish_time":1519578849207,"_cnpm_publish_time":1519578849207},"1.2.0":{"name":"napi-macros","version":"1.2.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"ed5e60017328109bbde22db5fd2bcffea348284d","_id":"napi-macros@1.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"9acb8e2cf930ad75ef4810082033949379ea742b","size":3360,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.2.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.2.0_1519574815552_0.527788015807958"},"_hasShrinkwrap":false,"publish_time":1519574815636,"_cnpm_publish_time":1519574815636},"1.1.0":{"name":"napi-macros","version":"1.1.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"066001ee7e836a660664f26d4b26308773c0856f","_id":"napi-macros@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"97191fbe27d06554de6b1461dec0d8f2a0949f3e","size":3312,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.1.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.1.0_1519426664812_0.6502997880588162"},"_hasShrinkwrap":false,"publish_time":1519426664869,"_cnpm_publish_time":1519426664869},"1.0.0":{"name":"napi-macros","version":"1.0.0","description":"Set of utility macros to make writing N-API modules a little easier.","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/napi-macros.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"homepage":"https://github.com/mafintosh/napi-macros","gitHead":"6021c88f0e02c45b5cb5867ef80c93670d7d310a","_id":"napi-macros@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"61ea3ae1ad694f5d19ea3d209719275116171bd3","size":3173,"noattachment":false,"key":"/napi-macros/-/napi-macros-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/napi-macros/download/napi-macros-1.0.0.tgz"},"maintainers":[{"name":"emilbayes","email":"github@tixz.dk"},{"name":"mafintosh","email":""},{"name":"ralphtheninja","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/napi-macros_1.0.0_1519393107484_0.855088237719037"},"_hasShrinkwrap":false,"publish_time":1519393107582,"_cnpm_publish_time":1519393107582}},"readme":"# napi-macros\n\nSet of utility macros to make writing [N-API](https://nodejs.org/dist/latest-v9.x/docs/api/n-api.html) modules a little easier.\n\n```\nnpm install napi-macros\n```\n\nThen add the following to your target in your binding.gyp file\n\n```\n\"include_dirs\": [\n  \"<!(node -e \\\"require('napi-macros')\\\")\"\n],\n```\n\nThese patterns mostly reflect how I use N-API so far. Feel free\nto PR more.\n\n## Usage\n\n``` c\n#include <node_api.h>\n#include <napi-macros.h>\n\nNAPI_METHOD(times_two) {\n  NAPI_ARGV(1)\n  NAPI_ARGV_INT32(number, 0)\n\n  number *= 2;\n\n  NAPI_RETURN_INT32(number)\n}\n\nNAPI_INIT() {\n  NAPI_EXPORT_FUNCTION(times_two)\n}\n```\n\nFull working example can be found in the [example/](https://github.com/mafintosh/napi-macros/tree/master/example) folder.\n\n## API\n\n#### `NAPI_INIT()`\n\nSetup init boilerplate. Pass the function body after.\n\n``` c\nstatic char *my_string = \"hello\";\n\nNAPI_INIT() {\n  EXPORT_STRING(my_string)\n}\n```\n\n#### `NAPI_METHOD(name)`\n\nSetup method boilerplate. Pass the function body after.\n\n``` c\nNAPI_METHOD(add) {\n  NAPI_ARGV(2)\n  NAPI_ARGV_INT32(a, 0)\n  NAPI_ARGV_INT32(b, 1)\n\n  a = a + b\n\n  NAPI_RETURN_INT32(a)\n}\n```\n\n#### `NAPI_ARGV(n)`\n\nSetup up argv boilerplate. `n` is how many arguments you are expecting.\nExpects the `napi_env` to be in scope as `env` and the `napi_callback_info` to be in scope as `info`.\n\n#### `NAPI_ARGV_BUFFER(name, index)`\n\nGet a buffer out of the arguments at the corresponding index.\nSets `char *name` and `size_t name_len` with the buffer and buffer length.\n\n#### `NAPI_ARGV_BUFFER_CAST(type, name, index)`\n\nGet a buffer out and cast the pointer to the specified type.\nNote that the type should include the pointer star, i.e.\n\n``` c\nNAPI_ARGV_BUFFER_CAST(uv_udp_t *, handle, 0)\n```\n\nWill cast the 1st argument as `uv_udp_t` pointer.\n\n#### `NAPI_ARGV_UINT32(name, index)`\n\nGet an argument as a uint32.\nWill throw if argument is not the right type.\n\n#### `NAPI_ARGV_INT32(name, index)`\n\nGet an argument as an int32.\nWill throw if argument is not the right type.\n\n#### `NAPI_ARGV_UTF8(name, length, index)`\n\nGet an argument as a utf8 string.\n\n`name` will be a `char[length]` array.\n\nWill throw if argument is not the right type.\n\n#### `NAPI_ARGV_UTF8_MALLOC(name, index)`\n\nGet an argument as a utf8 string.\n\n`name` will be a `char*`.\n\nLike `NAPI_ARGV_UTF8()` but allocates `name` on the heap using `malloc()`, which should be `free()`'d after usage.\n\n#### `NAPI_BUFFER_CAST(type, name, var)`\n\nSame as `NAPI_ARGV_BUFFER_CAST` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_BUFFER(name, var)`\n\nSame as `NAPI_ARGV_BUFFER` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_UTF8(name, size, var)`\n\nSame as `NAPI_ARGV_UTF8` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_UTF8_MALLOC(name, var)`\n\nSame as `NAPI_ARGV_UTF8_MALLOC` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_UINT32(name, var)`\n\nSame as `NAPI_ARGV_UINT32` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_INT32(name, var)`\n\nSame as `NAPI_ARGV_INT32` but takes a generic `napi_value` variable instead of an argv index.\n\n#### `NAPI_EXPORT_FUNCTION(fn)`\n\nWill export a function in the Init method. Expects the env and `exports` to be in scope.\nThe name of the exported function is the same name as the c function.\n\n#### `NAPI_EXPORT_SIZEOF(struct)`\n\nExport the size of a strict. The exported name is `sizeof_{struct-name}`.\n\n#### `NAPI_EXPORT_UINT32(name)`\n\nExport a uint32.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_INT32(name)`\n\nExport an int32.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_UTF8(name, len)`\n\nExport a utf8 string. `len` should be the length of the string.\nThe name of the exported string is the same name as the c variable.\n\n#### `NAPI_EXPORT_STRING(name)`\n\nExport a null terminated string.\nThe name of the exported string is the same name as the c variable.\n\n#### `NAPI_EXPORT_SIZEOF(type)`\n\nExports `sizeof(type)`.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_SIZEOF_STRUCT(structName)`\n\nExports `sizeof(struct structName)`.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_ALIGNMENTOF(type)`\n\nExports the byte alignment of `type`.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_ALIGNMENTOF_STRUCT(structName)`\n\nExports the byte alignment of `struct structName`.\nThe name of the exported number is the same name as the c variable.\n\n#### `NAPI_EXPORT_OFFSETOF(type, name)`\n\nExports the byte offset of `name` within `type`.\nThe name of the exported number is the same name as the c variables.\n\n#### `NAPI_EXPORT_OFFSETOF_STRUCT(structName, name)`\n\nExports the byte offset of `name` within `struct structName`.\nThe name of the exported number is the same name as the c variables.\n\n#### `NAPI_FOR_EACH(array, element)`\n\nIterate over an array. `array` should be a `napi_value` containing a javascript array\nand `element` is the variable name an element will be exposed as. Expects the loop body\nto be passed after.\n\n``` c\nnapi_value buffers = argv[0] // first argument is a js array\nNAPI_FOR_EACH(buffers, buffer) {\n  NAPI_BUFFER(cbuf, buffer)\n  printf(\"cbuf is now a char * pointer: %s\\n\", cbuf);\n}\n```\n\n#### `NAPI_RETURN_UINT32(name)`\n\nReturns a uint32.\n\n#### `NAPI_RETURN_INT32(name)`\n\nReturns an int32.\n\n#### `NAPI_RETURN_UTF8(name, len)`\n\nReturn a utf8 string. `len` should be the length of the string.\n\n#### `NAPI_RETURN_STRING(name)`\n\nReturn a null terminated string.\n\n#### `NAPI_STATUS_THROWS(call)`\n\nChecks the return status of any `napi_*` function returning a `napi_status` type. This simplifies using a `napi_status` variable and comparing the result with `napi_ok`. It's used internally but can be used stand alone as well.\n\n```c\nNAPI_STATUS_THROWS(\n  napi_create_threadsafe_function(\n    NULL,\n    callback,\n    0,\n    async_resource_name,\n    0,\n    3,\n    0,\n    my_finalize,\n    NULL,\n    my_callback,\n    &threadsafe_function\n  )\n);\n```\n\nAbove example will fail because the first `env` parameter is `NULL` and throw the following error:\n\n```\nError: napi_create_threadsafe_function(NULL, callback, 0, async_resource_name, 0, 3, 0, my_finalize, \\\nNULL, my_callback, &threadsafe_function) failed!\n```\n\n#### `NAPI_UV_THROWS(err, fn)`\n\nChecks if a libuv call fails and if so, throws an error.\n\n``` c\nint err;\nNAPI_UV_THROWS(err, uv_ip4_addr((char *) &ip, port, &addr))\n```\n\n#### `NAPI_MAKE_CALLBACK(env, async_ctx, ctx, func, argc, argv, result)`\n\nSame as `napi_make_callback` except it checks if the JS function throw an exception\nand triggers a `process.on('uncaughtException')` if so.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/napi-macros","bugs":{"url":"https://github.com/mafintosh/napi-macros/issues"},"license":"MIT"}