{"id":20666290,"url":"https://github.com/devpow112/codify-images","last_synced_at":"2025-04-19T16:42:24.877Z","repository":{"id":38094755,"uuid":"421885076","full_name":"devpow112/codify-images","owner":"devpow112","description":":computer: Simple tool for converting a set of images into inline JavaScript","archived":false,"fork":false,"pushed_at":"2024-11-15T09:21:05.000Z","size":2157,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-16T15:05:54.760Z","etag":null,"topics":["codeql","coveralls","dependabot","github-actions","image-converter","nodejs","semantic-release"],"latest_commit_sha":null,"homepage":"https://npmjs.com/codify-images","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/devpow112.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":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-27T16:03:32.000Z","updated_at":"2024-11-05T15:51:44.000Z","dependencies_parsed_at":"2023-10-11T19:37:05.768Z","dependency_job_id":"b1febacd-a1bf-4fc5-9e8d-d6c0f6dae0d1","html_url":"https://github.com/devpow112/codify-images","commit_stats":{"total_commits":411,"total_committers":5,"mean_commits":82.2,"dds":"0.33333333333333337","last_synced_commit":"865c519e66a2a18b73676e54d549e6d52a64c4dc"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpow112%2Fcodify-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpow112%2Fcodify-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpow112%2Fcodify-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpow112%2Fcodify-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devpow112","download_url":"https://codeload.github.com/devpow112/codify-images/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224964670,"owners_count":17399433,"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":["codeql","coveralls","dependabot","github-actions","image-converter","nodejs","semantic-release"],"created_at":"2024-11-16T19:36:32.599Z","updated_at":"2024-11-16T19:36:37.378Z","avatar_url":"https://github.com/devpow112.png","language":"JavaScript","readme":"# Codify Images\n\n[![License][License Badge]](LICENSE)\n[![Version][Version Badge]][Version Package]\n[![Release][Release Badge]][Release Workflow]\n[![Coverage][Coverage Badge]][Coverage Report]\n[![Node Version][Node Version Badge]](package.json#L75)\n\nQuick and easy tool for converting a set of images into inline JavaScript.\n\n## Installation\n\n```console\nnpm i -D codify-images\n```\n\n## Usage\n\nThere are 2 uses of this package either as a library or a command line interface\n(CLI).\n\n### Library\n\nAn example of typical usage as a library can be found below.\n\n```js\nimport { codifyImages, codifyImagesSync } from 'codify-images';\n\nconst options = {\n  svgMode: 'base64',\n  ignoreUnsupportedTypes: true,\n  log: (name, path) =\u003e {...}\n};\nlet images = await codifyImages('path/to/assets', options); // asynchronous\n\nimages = codifyImagesSync('path/to/assets', options); // synchronous\n```\n\nThe `images` object returned will have a member for each file, of supported\ntype, found at the location `path/to/assets` formatted as camel case. Assuming\n`path/to/assets` has 3 files in that location (`test.gif`, `test.png` and\n`test.svg`) the resulting `images` would look like the following.\n\n```js\nconst images = {\n  testGif: 'data:image/gif;base64,...',\n  testPng: 'data:image/png;base64,...',\n  testSvg: 'data:image/svg+xml;base64,...'\n};\n```\n\n#### Options\n\n* `svgMode`: Allows you to supply the `mode` that will be used to generate SVG\n  outputs. The current options are `base64`, `uri`, `mini`, `mini-srcset`. The\n  default for this setting is `base64` and is the recommended setting as it has\n  the highest compatibility with different use cases. For more info related to\n  the `mini` and `mini-srcset` modes please consult the [Mini SVG Data] package\n  documentation.\n* `ignoreUnsupportedTypes`: This will allow files of unsupported types to be\n  simply skipped instead of throwing an `UnsupportedTypeError` error. The\n  default for this setting is `true`.\n* `log`: This allows you to add a custom logger that will be called after each\n  file is processed. The callback provides the arguments `name` and `path`.\n\n### CLI\n\nBelow is the output of `codify-images --help`.\n\n```console\nUsage: codify-images [options] \u003cinput path\u003e\n\nArguments:\n  input path                  path to where image files reside\n\nOptions:\n  -V, --version               output the version number\n  -d, --double-quotes         Use double quotes for output instead of single quotes (default: false)\n  -o, --output \u003cpath\u003e         path to write generated files (default: \"generated\")\n  -e, --es \u003cversion\u003e          version of ESM to generate (default: 6)\n  -c, --indent-count \u003ccount\u003e  number of indent elements to output (default: 1)\n  -B, --no-banner             do not include banner comment at top of generated file\n  -t, --indent-type \u003ctype\u003e    type of indent to output (choices: \"tab\", \"space\", default: \"tab\")\n  -s, --svg-mode \u003cmode\u003e       output mode to use for SVG images\n                              (choices: \"base64\", \"uri\", \"mini\", \"mini-srcset\", default: \"base64\")\n  -h, --help                  display help for command\n```\n\n## Development\n\nDevelopment can be done on any machine that can install **Node.js**. Only the\nlatest LTS version is tested against.\n\n### Install Dependencies\n\nInstall dependencies via `npm`.\n\n```console\nnpm i\n```\n\n### Linting\n\nExecute linters via `npm`.\n\n```console\n# git, javascript, markdown and package.json\nnpm run lint\n\n# git only\nnpm run lint:git\n\n# javascript only\nnpm run lint:js\n\n# markdown only\nnpm run lint:md\n\n# package.json only\nnpm run lint:pkg\n```\n\n### Testing\n\nExecute tests via `npm`.\n\n```console\n# lint and unit tests\nnpm test\n\n# unit tests only\nnpm run test:unit\n```\n\n### Fixing\n\nExecute fixers via `npm`.\n\n```console\n# javascript, markdown and package.json\nnpm run fix\n\n# javascript only\nnpm run fix:js\n\n# markdown only\nnpm run fix:md\n\n# package.json only\nnpm run fix:pkg\n```\n\n### Building\n\nRun a build via `npm`.\n\n```console\nnpm run build\n```\n\n\u003c!-- links --\u003e\n[License Badge]: https://img.shields.io/github/license/devpow112/codify-images?label=License\n[Version Badge]: https://img.shields.io/npm/v/codify-images?label=Version\n[Version Package]: https://www.npmjs.com/codify-images\n[Node Version Badge]: https://img.shields.io/node/v/codify-images\n[Release Badge]: https://github.com/devpow112/codify-images/actions/workflows/release.yml/badge.svg?branch=main\n[Release Workflow]: https://github.com/devpow112/codify-images/actions/workflows/release.yml?query=branch%3Amain\n[Coverage Badge]: https://img.shields.io/coveralls/github/devpow112/codify-images/main?label=Coverage\n[Coverage Report]: https://coveralls.io/github/devpow112/codify-images?branch=main\n[Mini SVG Data]: https://www.npmjs.com/package/mini-svg-data-uri\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpow112%2Fcodify-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevpow112%2Fcodify-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpow112%2Fcodify-images/lists"}