{"id":13802924,"url":"https://github.com/shepherdwind/joycss","last_synced_at":"2025-08-24T06:34:38.865Z","repository":{"id":2143164,"uuid":"3087447","full_name":"shepherdwind/joycss","owner":"shepherdwind","description":"css auto sprite tool by nodejs","archived":false,"fork":false,"pushed_at":"2020-05-02T21:07:48.000Z","size":2050,"stargazers_count":46,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-08T21:50:56.013Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shepherdwind.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-02T12:48:43.000Z","updated_at":"2022-03-29T11:05:37.000Z","dependencies_parsed_at":"2022-08-19T21:22:03.801Z","dependency_job_id":null,"html_url":"https://github.com/shepherdwind/joycss","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/shepherdwind/joycss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shepherdwind%2Fjoycss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shepherdwind%2Fjoycss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shepherdwind%2Fjoycss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shepherdwind%2Fjoycss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shepherdwind","download_url":"https://codeload.github.com/shepherdwind/joycss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shepherdwind%2Fjoycss/sbom","scorecard":{"id":817851,"data":{"date":"2025-08-11","repo":{"name":"github.com/shepherdwind/joycss","commit":"7ddefff1b0dd0e2acc8fa01b0ef00ab222edddfa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":7,"reason":"binaries present in source code","details":["Warn: binary detected: bin/optipng.exe:1","Warn: binary detected: bin/pngquant.exe:1","Warn: binary detected: lib/graph/java/spritebuilder-1.0.0.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T14:38:14.462Z","repository_id":2143164,"created_at":"2025-08-23T14:38:14.463Z","updated_at":"2025-08-23T14:38:14.463Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271808574,"owners_count":24825523,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-08-04T00:02:05.380Z","updated_at":"2025-08-24T06:34:38.799Z","avatar_url":"https://github.com/shepherdwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"joycss \n======\n\n[![Build Status](https://img.shields.io/travis/shepherdwind/joycss.svg?style=flat)](https://travis-ci.org/shepherdwind/joycss)\n[![Coverage Status](https://img.shields.io/coveralls/shepherdwind/joycss/master.svg?style=flat)](https://coveralls.io/r/shepherdwind/joycss)\n\n[![NPM](https://nodei.co/npm/joycss.png?downloads=true)](https://nodei.co/npm/joycss/)\n\njoycss是一个基于nodejs的自动拼图工具, 目标：\u003cstrong\u003e使用简单，功能强大\u003c/strong\u003e 。\n\n### 图片处理\n\n图片处理部分，现在有两种方案可以使用\n\n1. php, 需要命令行有php命令，并且php需要开启gd库扩展(默认是开启的)\n2. java 需要有jre就可以了，java图片处理比php要慢不少，默认使用的是php\n\n没有采用node c++扩展的方式，主要考虑到跨平台编译c++扩展，尤其是windows，太麻烦了。\n\n###安装\n\n```sh\nnpm install -g joycss\n//update\nnpm update joycss -g\n```\n\n如果依赖有问题，查看[安装指南](https://github.com/shepherdwind/joycss/wiki/how-to-install)\n\n###使用\n\n```sh\n$ joycss a.css\n$ joycss a.less\n$ joycss a.less -o out\n```\n\n#### 命令行参数\n\n|参数|全称|含义|\n|---|---|----|\n|-c| --close | 紧凑拼图 |\n|-x| --horizontal\t| 水平布局 |\n|-a| --alpha | 只生成png24图片(默认情况同时png8和png24)|\n|-o| --output| 输出文件夹, 默认是`build` |\n|| --api| 调用拼图api，支持php和java，默认使用php(java图片处理要慢3倍的样子) |\n|| --debug| 输出debug信息 |\n\n上面参数中，`-o,--output`，用于存放输出的文件，包括图片和css，生成文件命名规则\n是如下:\n\n```\n$ joycss base.css -o out\n\nout\n|-- base-sprite.png\n|-- base-sprite8.png\n`-- base.css\n```\n\n#### 拼图方式\n\n支持3种拼图方式，上面命令行参数中配置的`-x, -h`两个配置，用于选择拼图算法，默认\n情况是垂直布局，close表示紧凑拼图，-x表示水平布局拼图。\n\n在默认算法中，如果可以通过当前样式活动选择器的高宽，会自动使用紧凑算法。\n\n### API使用\n\n```js\nvar Joycss = require('joycss');\nvar options = {\n  destCss: __dirname + '/build/base.css'\n};\n\nnew Joycss(__dirname + '/base.css', options)\n  .run(function(err, result){\n    if (err) {\n      throw new Error(err);\n    }\n\n    // result is the result of cssText\n    console.log('build success');\n  });\n\n// or\nvar joycss = new Joycss(__dirname + '/base.css', options);\nvar cssText = yield joycss.run();\nconsole.log('build success');\n\nvar destImg = joycss.options.destImg;\n```\n\n#### options 配置\n\n```\n{\n  /**\n   * 图片目标地址，如果没有指定，默认图片和生成的css地址一致\n   */\n  destImg: null,\n  /**\n   * 生成css地址，如果不指定，和源css路径一致\n   */\n  destCss: null,\n  /**\n   * cssText，css字符串，当存在cssText，不需要从文件中读取css字符串，第一参数\n   * filename用于查找css中图片路径，比如css中图片../size.png，filename是/a/b/\n   * 那么图片的绝对路径就是/a/size.png\n   */\n  cssText: null,\n  /**\n   * 使用png8模式，如果设置为false，生成png24图\n   */\n  force8bit : true,\n  /**\n   * 拼图算法，支持三种'auto | close | vertical | horizontal'\n   * auto自动拼图，如果知道图片所在的盒子大小，使用紧凑拼图，否则独占一行\n   * close: 紧凑拼图，搜有图片使用紧凑拼图\n   * vertical: 垂直布局,\n   * horizontal: 水平布局\n   */\n  layout : 'auto',\n\n  // 是否保存css文件到destCss, 用在gulp这样的工具时可以用上\n  save: true,\n\n  // 图片命令行工具，支持php或者java，如果没有尝试执行php和java，自动选择\n  api: 'auto'\n}\n```\n\n##Questions\n\n提问有几种方式\n\n1. 新建[issue](https://github.com/shepherdwind/velocity.js/issues/new)\n2. 邮件到eward.song at gmail.com\n3. 阿里内部员工，可以通过hanwen.sah搜到我的旺旺\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshepherdwind%2Fjoycss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshepherdwind%2Fjoycss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshepherdwind%2Fjoycss/lists"}