{"id":15731623,"url":"https://github.com/tuchk4/script-arts","last_synced_at":"2025-07-23T21:34:19.027Z","repository":{"id":74998500,"uuid":"59828083","full_name":"tuchk4/script-arts","owner":"tuchk4","description":"Another one npm package :) Encode any text files into images and decode them back.","archived":false,"fork":false,"pushed_at":"2017-07-24T10:04:13.000Z","size":18,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T18:24:39.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuchk4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-27T10:55:40.000Z","updated_at":"2022-01-11T14:02:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5ead9e1-760a-41b5-9617-0717130ec60e","html_url":"https://github.com/tuchk4/script-arts","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"5edaaaaf2a7a880f7d84afa0ae38ce03b29b27e2"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuchk4%2Fscript-arts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuchk4%2Fscript-arts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuchk4%2Fscript-arts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuchk4%2Fscript-arts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuchk4","download_url":"https://codeload.github.com/tuchk4/script-arts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243341406,"owners_count":20275866,"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":"2024-10-04T00:02:49.528Z","updated_at":"2025-03-13T04:31:05.565Z","avatar_url":"https://github.com/tuchk4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Script arts\n---\n\nAnother one npm package :) Encode any text files into images and decode them back.\n\n## If you ask \"Why\"?\n\n\"Code like no one's watching.\" [@noopkat](https://twitter.com/noopkat)\nFrom [#jsconf Budapest](http://jsconfbp.com/) [\"Formulartic Spectrum\"](http://jsconfbp.com/speakers/suz-hinton.html).\n\n## Just imagine\n\n- transform your code into images\n- apply instagram filters\n- BOOM! Your code is refactored now :)\n\n## Usage\n\n```bash\nnpm install -g script-arts\n\nscript-arts --help\nscript-arts encode --help\nscript-arts decode --help\n```\n\n## Glossary\n\n* Theme - is a symbol encode (symbol to rgb) / decode (rgb to symbol) rule.\n  ```js\n  {\n    encode: function(symbol),\n    decode: function(rgb)\n  }\n  ```\n\n* Iterator - is how we will iterate image and source file. Could be linear, or by lines or even radial. Also responsible on image size and form.\n  ```js\n  {\n    iterateSource: function(source, encode),\n    iterateImage: function(image, decode)\n  }\n  ```\n\n## Iterators\n\n* **linear** *(default)* `script-arts encode source output -i linear`. Iterate by symbols\n\n* **lines** `script-arts encode source output -i lines`. Iterate by lines\n\n## Themes\n\n* **char code** *(default)* `script-arts encode source output -t char-code`. Translate symbol code to hex. `-d \u003cnumber\u003e` code offset. If delta was used for encode - same value should be used for decode.\n\n* **spaces and semicolons** `script-arts encode source output -t spaces-and-semicolons`. Highlite spaces and semicolons. Other symbols will be encoded with char-code theme.\n\n* **js** `script-arts encode source output  -t js`. Highlite js keywords.\n\n* **md** `script-arts encode source output  -t md`. Highlite md keywords.\n\n## Custom theme\n\nExisting themes:\n\n- [char-code-theme](https://github.com/tuchk4/script-arts/blob/master/src/themes/char-code-theme.js)\n- [js-theme](https://github.com/tuchk4/script-arts/blob/master/src/themes/js-theme.js)\n- [md-theme](https://github.com/tuchk4/script-arts/blob/master/src/themes/md-theme.js)\n- [spaces-and-semicolons](https://github.com/tuchk4/script-arts/blob/master/src/themes/spaces-and-semicolons-theme.js)\n\n```js\nimport chartCodeTheme from 'script-arts/themes/char-code-theme';\nimport { add as addTheme } from 'script-arts/src/themes';\nimport encode from 'script-arts/encode';\n\nconst myTheme = options =\u003e {\n  return chartCodeTheme({\n    ...options,\n    matches: {\n      // encode whole words with specific colors\n      'constructor': '#ffcc33',\n      'var': '#cc0000',\n      'const': '#54DE43',\n      'new': '#54DE43',\n      // encode each symbol of \"decode\" word with specific color\n      'for': ['#E74C3C', '#ECF0F1', '#ECF0F1']\n    }\n  }),\n}\n\naddTheme('my-theme', {\n  create: myTheme,\n  // bottom left image corner will be marked with this color\n  // will be used for decode() - automatically detect encoded theme.\n  color: '#47D0DB'\n});\n\nencode('path/to/source-file', 'path/to/output-image', {\n  theme: 'my-theme',\n  iterator: 'lines',\n  delta: 2512 // if you want to make char code offset\n}).then(() =\u003e {\n  console.log('done');\n})\n```\n\n## Custom iterator\n\nSames as custom themes. Default iterators example:\n\n- [Linear iterator](https://github.com/tuchk4/script-arts/blob/master/src/iterators/linear-iterator.js)\n- [Lines iterator](https://github.com/tuchk4/script-arts/blob/master/src/iterators/lines-iterator.js)\n- [How to Add iterator](https://github.com/tuchk4/script-arts/blob/master/src/iterators/index.js)\n\n## Contribute\n\nYou are welcome to this useless app better :)\n\nUse `npm run dev` to start watchers and convert ES6 code from */src/* dir.\nUse `npm run test` - to run tests.\nUse `npm run test-dev` - to start tests with watchers.\n\n## Encode examples: parts of lodash source with different options\n\n\u003cimg alt=\"lodash encode example\" src=\"http://image.prntscr.com/image/ccbe9a9b5ce349bbb81dc09993acf65a.png\" width=\"250\" height=\"250\"\u003e \u003cimg alt=\"lodash encode example\" src=\"http://image.prntscr.com/image/6dc174171ff54c5785d97f87d5467dd6.png\" width=\"250\" height=\"250\"\u003e \u003cimg alt=\"lodash encode example\" src=\"http://image.prntscr.com/image/91c13624df1240349a60428ca380cd94.png\" width=\"250\" height=\"250\"\u003e\n\n- [Additional exmaple#1](http://image.prntscr.com/image/89c5b31f90d14ed1aae3a457489792ac.png)\n- [Additional exmaple#2](http://image.prntscr.com/image/ecb30acba8484cbbb0269d6806b648a2.png)\n\n## Encode examples of this README file\n\n\u003cimg alt=\"README encode example\" src=\"http://image.prntscr.com/image/5bdb76a324e54f22b99cd3865aec8fe7.png\" width=\"250\" height=\"250\"\u003e \u003cimg alt=\"README encode example\" src=\"http://image.prntscr.com/image/24e7b4189d2b4d9e804ee903def3792c.png\" width=\"250\" height=\"250\"\u003e \u003cimg alt=\"README encode example\" src=\"http://image.prntscr.com/image/283709d672aa40609a85819447aa4b99.png\" width=\"250\" height=\"250\"\u003e\n\n## Tests\n\nTests are ok. But travis fails. And I dont care :)\n\n\u003cimg alt=\"Tests output\" src=\"http://image.prntscr.com/image/1599c4ac36a04e3988092b3acc229c5b.png\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuchk4%2Fscript-arts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuchk4%2Fscript-arts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuchk4%2Fscript-arts/lists"}