{"analyzedAt":"2022-07-03T18:32:40.172Z","collected":{"metadata":{"name":"color-sensor-js","scope":"unscoped","version":"0.0.15","description":"Color sensors kit supporting TCS34725 (I2C) or simulator","keywords":["color","colorsensor","color-sensor","generic","generic-sensor","i2c","colour","iotjs","iotjs-module","iotjs-supported","moziot","rgb","sensor","sensors","TCS34725","tcs3472X","w3c","webthing"],"date":"2021-03-31T09:38:31.079Z","author":{"name":"Philippe Coval","email":"p.coval@users.sf.net","url":"https://www.npmjs.com/~rzr"},"publisher":{"username":"rzr","email":"rzr@users.sf.net"},"maintainers":[{"username":"rzr","email":"rzr@users.sf.net"}],"repository":{"type":"git","url":"git+https://github.com/rzr/color-sensor-js.git"},"links":{"npm":"https://www.npmjs.com/package/color-sensor-js","homepage":"https://libraries.io/npm/color-sensor-js","repository":"https://github.com/rzr/color-sensor-js","bugs":"https://github.com/rzr/color-sensor-js/issues"},"license":"Apache-2.0","dependencies":{"wiringpi-iotjs":"^0.0.6"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^7.23.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.3.1","eslint-plugin-standard":"^5.0.0"},"optionalDependencies":{"wiringpi-iotjs":"^0.0.6"},"releases":[{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1},{"from":"2020-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":3}],"hasTestScript":true,"readme":"# COLOR-SENSOR-JS #\n\n[![GitHub forks](\nhttps://img.shields.io/github/forks/rzr/color-sensor-js.svg?style=social&label=Fork&maxAge=2592000\n)](\nhttps://GitHub.com/rzr/color-sensor-js/network/\n)\n[![license](\nhttps://img.shields.io/badge/license-Apache-2.0.svg\n)](\nLICENSE\n)\n[![Release](\nhttps://github.com/rzr/color-sensor-js/workflows/Release/badge.svg\n)(\nhttps://github.com/rzr/color-sensor-js/actions?query=workflow%3ARelease\n)\n[![NPM](\nhttps://img.shields.io/npm/v/color-sensor-js.svg\n)](\nhttps://www.npmjs.com/package/color-sensor-js\n)\n[![IRC Channel](\nhttps://img.shields.io/badge/chat-on%20freenode-brightgreen.svg\n)](\nhttps://kiwiirc.com/client/irc.freenode.net/#iot\n)\n[![Codacy Badge](\nhttps://api.codacy.com/project/badge/Grade/9eaea080afea42e295b8778133446bbd\n)](\nhttps://app.codacy.com/app/rzr/color-sensor-js?utm_source=github.com&utm_medium=referral&utm_content=rzr/color-sensor-js&utm_campaign=Badge_Grade_Dashboard\n)\n[![Fediverse](\nhttps://img.shields.io/mastodon/follow/279303?domain=https%3A%2F%2Fmastodon.social&style=social\n)](\nhttps://mastodon.social/@rzr/104138640136323272#https://purl.org/rzr/sensors\n)\n\n[![NPM](\nhttps://nodei.co/npm/color-sensor-js.png\n)](\nhttps://npmjs.org/package/color-sensor-js\n)\n\n## INTRODUCTION ##\n\nThis module is supporting TCS34725 I2C sensor\nand also provide a simulator that return random colors.\n\n[![Presentation](\nhttps://camo.githubusercontent.com/a31c09f76b5309cc7fbf0122a271913a5c9d91a3/68747470733a2f2f696d6167652e736c696465736861726563646e2e636f6d2f776f7478722d3230313930333230727a722d3139303332313133333434362f39352f776f7478723230313930333230727a722d312d3633382e6a7067#./file/wotxr-20190320rzr.jpg\n)](\nhttp://www.slideshare.net/slideshow/embed_code/key/cPtJI8DNhzpE4#wotxr-20190320rzr\n\"WoTxR\")\n\nIt should work with Adafruit RGB Color Sensor\nwith IR Filter and White LED - TCS34725 [ADA1334] :\n\n-   <https://www.amazon.com/Adafruit-Color-Sensor-Filter-White/dp/B00OKCRU5M/ref=rzr-21#>\n-   <https://www.adafruit.com/product/1334>\n\n## USAGE ##\n\nNode.js and IoT.js runtimes are supported.\n\nUsage is straightforward.\n\nBy default simulator is used, and output are in web hex format (#RrGgBb),\nbut lower level use is also possible.\n\nFor using I2C TCS34725 sensor, check i2c chapter first.\n\n### USING IOT.JS ###\n\nInstall recent version of IoT.js:\n\n-   <https://github.com/rzr/webthing-iotjs/wiki/IotJs>\n\n```sh\ngit clone --recursive --depth 1 https://github.com/rzr/color-sensor-js\ncd color-sensor-js\n\nmake test\n#| iotjs lib/simulator.js\n#| log: value=[7779,36778,11173,42766]\n#| log: test: test/iotjs\n\nmake start\n#| {\"color\": \"#badc0d\"}\n#| {\"color\": \"#c0ffee\"}\n#| (...)\n\n# Or to use actual sensor:\nmake start run_args=tcs34725\n#| iotjs example tcs34725\n#| {\"color\": \"#ff514a\"}\n#| (...)\n\n# Raw driver's values:\niotjs lib/tcs34725.js\n#| log: value=[65535,20885,19074,65535]\n\n```\n\n### USING NODE.JS ###\n\n```sh\n# git clone or use install released package:\n\nnpm install color-sensor-js\ncd node_modules/color-sensor-js\n\nnpm install --only=prod\nnpm test\n#| > node lib/simulator\n#| log: value=[11409,49339,1907,5849]\n\nnpm start\n#| node example\n#| {\"color\": \"#c0ffee\"}\n#| (...)\n\n# Or to use actual sensor:\nnode example tcs34725\n#| {\"color\": \"#ff514a\"}\n#| (...)\n\n# Raw driver's values:\nnode lib/tcs34725.js\n#| log: value=[65535,20908,19103,65535]\n```\n\n### NOTES ###\n\nOn issues make sure that your system have I2C,\ndevice should be visible by user before using it:\n\n```sh\nsudo apt-get install i2c-tools make git\ni2cdetect -y 1\n#|      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n#| (...)\n#| 20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --\n#| (...)\n```\n\nOn Raspbian, pi \"user\" is in \"i2c\" group of file \"/dev/i2c-1\"\n(matching RaspberryPi's header).\n\n## WEBTHING EXAMPLE ##\n\nAn extra example is provided for use from the Web (WebOfThings).\n\nIt's using Mozilla's IoT Schema and can be used as standalone\nor connected to things Gateway:\n\n```sh\ncd example/color-sensor-webthing\nnpm install\nnpm start\n\ncurl http://localhost:8888/properties/color\n#| {\"color\":\"#6ab302\"}\n```\n\nTCS34725 sensor can be selected from command line, and port eventually changed:\n\n```sh\ncd example/color-sensor-webthing/\nnpm install\nnpm start 8888 tcs34725\n```\n\nMay I recommend to give a try with IoT.js runtime,\nit is faster and consuming much less resources:\n\n```sh\nmake -C example/color-sensor-webthing start\n```\n\n[![schemas](\nhttp://image.slidesharecdn.com/iot-javascript-2019-fosdem-190206130525/95/iotjavascript2019fosdem-26-638.jpg\n)](\nhttps://www.slideshare.net/rzrfreefr/iotjavascript2019fosdem/26\n\"Schema\")\n\n### CLIENTS ###\n\nWebthings servers are designed to be connected Mozilla's IoT\nwhich play the client role, but nothing prevent to create your own,\nin CLI (using IoT.js or Node.js) or browser.\n\nFor web app clients try to open this page, some are listed:\n\n-   <http://rzr.github.io/color-sensor-js/>\n-   HTML one: Background should be updated in realtime\n-   A-Frame one: will also display update in 3D in browser or VR/AR headset\n\nNote, if you want to create your app offline you can use static contents:\n\n-   <http://rzr.github.io/color-sensor-js/example/color-sensor-webthing/extra/json/>\n\nOff course, prefix path (and suffix if loading from file:) should be adjusted,\nor overloaded using CGI params.\n\nYou can even run webthings in the cloud:\n\n-   <http://rzr.github.io/color-sensor-js/example/color-sensor-webthing/extra/aframe.html?&url=https://color-sensor-webthing.glitch.me>\n\n[![aframe-webthing](\nhttps://speakerd.s3.amazonaws.com/presentations/9d6091c2266448b88daab13082337882/slide_29.jpg#aframe-webthing\n)](\nhttp://purl.org/aframe-webthing#\n\"aframe-webthing\")\n\n## DEMOS ##\n\n[![demo](\nhttps://image.slidesharecdn.com/mozilla-things-fosdem-2019-190207162845/95/mozillathingsfosdem2019-24-638.jpg\n)](\nhttps://www.slideshare.net/rzrfreefr/mozillathingsfosdem2019/25\n\"Demo\")\n\nIn \"webthing-iotjs-opendata-20190202rzr\" video, sensor is observing the lamp color,\nbut it can work with any regular material.\n\n[![Presentation](\nhttps://mastodon.social/@rzr/105983652802470207#wotxr20190320rzr\n)](\nhttps://mastodon.social/@rzr/103612381551603447#wotxr20190320rzr\n\"WebThingIotJs\"\n)\n\nA-Frame can also been used for rendering.\n\n## RESOURCES ##\n\n-   <https://purl.org/rzr/>\n-   <https://purl.org/rzr/sensors>\n-   <http://rzr.github.io/rzr-presentations/docs/sensors-webthings>\n-   <https://libraries.io/npm/color-sensor-js>\n-   <https://www.openhub.net/p/color-sensor-js>\n-   <https://yarnpkg.com/package/color-sensor-js>\n-   <https://hacks.mozilla.org/2019/03/connecting-real-things-to-virtual-worlds-using-web/>\n-   <https://mastodon.social/@rzr/103612381551603447#ColorSensor>\n-   <https://ams.com/tcs34725>\n-   <https://ams.com/documents/20143/36005/TCS3472_DS000390_2-00.pdf>\n-   <https://www.broadcom.com/products/optical-sensors/integrated-ambient-light-and-proximity-sensors/apds-9960>\n-   <https://github.com/rzr/webthing-iotjs/wiki/Sensor>\n-   <https://github.com/rzr/generic-sensors-lite>\n-   <https://github.com/rzr/mozilla-iot-generic-sensors-adapter/>\n-   <https://fosdem.org/2019/schedule/event/project_things/>\n-   <https://api.npms.io/v2/package/color-sensor-js>\n-   <https://npm.runkit.com/color-sensor-js>\n-   <https://github.com/jerryscript-project/iotjs-modules>\n-   <https://github.com/w3c/ambient-light/issues/9>\n-   <https://www.af83.com/in-realtime/laval-virtual-2019>\n-   <https://en.wikipedia.org/wiki/Colorimetry>\n-   <https://github.com/kelly/node-i2c/issues/90>\n-   <https://github.com/WiringPi/WiringPi-Node/blob/master/DOCUMENTATION.md#tcs34725>"},"npm":{"downloads":[{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-06-26T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":23},{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":64},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":374},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":792},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1749}],"starsCount":0},"github":{"homepage":"https://github.com/rzr/webthing-iotjs/wiki/Sensor","starsCount":1,"forksCount":2,"subscribersCount":2,"issues":{"count":12,"openCount":6,"distribution":{"3600":0,"10800":0,"32400":0,"97200":4,"291600":0,"874800":0,"2624400":1,"7873200":1,"23619600":1,"70858800":3,"212576400":2},"isDisabled":false},"contributors":[{"username":"mend-bolt-for-github[bot]","commitsCount":1},{"username":"rzr","commitsCount":187},{"username":"codacy-badger","commitsCount":1},{"username":"dependabot[bot]","commitsCount":4}],"commits":[{"from":"2022-06-26T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-06-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-04-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2022-01-04T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":0},{"from":"2021-07-03T00:00:00.000Z","to":"2022-07-03T00:00:00.000Z","count":1}],"statuses":[{"context":"github/pages","state":"success"}]},"source":{"files":{"readmeSize":7344,"testsSize":0},"badges":[{"urls":{"original":"https://img.shields.io/npm/v/color-sensor-js.svg","shields":"https://img.shields.io/npm/v/color-sensor-js.svg","content":"https://img.shields.io/npm/v/color-sensor-js.json"},"info":{"service":"npm","type":"version","modifiers":{"type":"v"}}},{"urls":{"original":"https://api.codacy.com/project/badge/Grade/9eaea080afea42e295b8778133446bbd","service":"https://api.codacy.com/project/badge/Grade/9eaea080afea42e295b8778133446bbd","shields":"https://img.shields.io/codacy/grade/9eaea080afea42e295b8778133446bbd.svg","content":"https://img.shields.io/codacy/grade/9eaea080afea42e295b8778133446bbd.json"},"info":{"service":"codacy","type":"quality"}},{"urls":{"original":"https://nodei.co/npm/color-sensor-js.png","shields":"https://img.shields.io/npm/v/color-sensor-js.svg","content":"https://img.shields.io/npm/v/color-sensor-js.json"},"info":{"service":"npm","type":"version"}}],"linters":["eslint"]}},"evaluation":{"quality":{"carefulness":0.42,"tests":0.25,"health":1,"branding":0.85},"popularity":{"communityInterest":9,"downloadsCount":124.66666666666667,"downloadsAcceleration":-0.7625570776255709,"dependentsCount":0},"maintenance":{"releasesFrequency":0.3113013698630137,"commitsFrequency":0.011506849315068493,"openIssues":0.5,"issuesDistribution":0}},"score":{"final":0.31682995564511995,"detail":{"quality":0.7632592466351253,"popularity":0.04230845266207162,"maintenance":0.20869778063673516}}}