{"id":27103140,"url":"https://github.com/studiole/node-colour-challenge","last_synced_at":"2025-10-30T02:13:03.460Z","repository":{"id":25267224,"uuid":"28692597","full_name":"StudioLE/node-colour-challenge","owner":"StudioLE","description":"A Node.js response to the colour code challenge","archived":false,"fork":false,"pushed_at":"2023-01-06T02:31:13.000Z","size":872,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T14:41:25.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StudioLE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-01T18:32:54.000Z","updated_at":"2021-05-30T08:25:17.000Z","dependencies_parsed_at":"2023-01-14T02:26:13.566Z","dependency_job_id":null,"html_url":"https://github.com/StudioLE/node-colour-challenge","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Fnode-colour-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Fnode-colour-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Fnode-colour-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Fnode-colour-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StudioLE","download_url":"https://codeload.github.com/StudioLE/node-colour-challenge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247516708,"owners_count":20951707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-06T16:39:29.740Z","updated_at":"2025-10-30T02:12:58.413Z","avatar_url":"https://github.com/StudioLE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Colour Code Challenge\n\nThe aim of the colour challenge is to create a script to randomly generate an RGB colour every hour and programmatically name it with an adjective + noun.\n\nThe challenge was created as a way to compare the syntax between languages with a commonly themed application.\n\n## Demo\n\n[View a demonstration](https://colourchallenge.studiole.uk).\n\n## Node.js Colour Code Challenge\n\nThis version is written in [Node.js](http://nodejs.org/) and available as a package to download from [NPM](https://www.npmjs.com/).\n\n### Methodology\n\nThe application follows MVC principles:\n\n- All data is read and written through functions within the util module `./lib/util.js`. The data is stored within a JSON file.\n- The view is located at `./views/log.mst` written in HTML5 using mustache templating\n- Three controllers provide the operations, these are `./lib/add.js`, `./lib/server.js` and `./lib/clear.js`\n\nEach operation is accessed through `./lib/cli.js` which acts as the command line interface. They can also be accessed through `./bin/cli` which NPM adds to the users path as `colour-challenge` when installed.\n\nTo log the data hourly `colour-challenge add` should be defined as a cron job.\n\n### Installation\n\nThe application requires Node.js and npm to be installed, instructions can be found at [nodejs.org](http://nodejs.org/). \n\nWith Node installed use the following to install the application globally.\n\n```\nnpm install -g colour-challenge\n```\n\nAlternatively install direct from the repository.\n\n```\nnpm install -g https://github.com/StudioLE/node-colour-challenge.git\n```\n\n## Configuration\n\nThe app uses [node-config](https://github.com/lorenwest/node-config) so it's highly configurable. I recommend copying the `./config/default.json` file to `./config/local.json` and editing that so that your changes are not overwritten by future updates.\n\n```\ncd /usr/lib/node_modules/colour-challenge\ncp config/default.json config/local.json\nnano config/local.json\n```\n\n### Usage\n\nAdd a single colour to the log\n```\ncolour-challenge add\n```\n\nAdd multiple colours to the log\n```\ncolour-challenge add 10\n```\n\nClear all previous logs\n```\ncolour-challenge clear\n```\n\nSpin up a server to view the logs\n```\ncolour-challenge server\n```\n\n### Cron Setup\n\nTo run the script on the hour every hour you will want to configure a cron job similar to the following:\n\n```\n0 * * * * colour-challenge add\n```\n\n## Participate\n\nNow you've seen how it's done why don't you take a shot in the language of your own choice? Or perhaps there's a framework you've been dying to try out? Give it a go and send us a link to your repository. The challenge is great for participants of all levels of experience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiole%2Fnode-colour-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiole%2Fnode-colour-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiole%2Fnode-colour-challenge/lists"}