Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-sprites

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-sprites

自动合并图片的模块

  • 0.1.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Elves

安装

npm install auto-sprites -g

使用

sprites <root> <source> <target> <sprites> [base64] [level]
  • root 文件存放的根目录,比如htdocs

  • source 指定编译的文件夹,比如/css/6v

  • target 指定编译后文件存放的位置 比如/css/6v

  • sprites 指定图片文件存放的位置 比如/simg

  • base64是否启用base64编码

  • level 以文件或者文件夹的维度合并图片,默认值为file

支持合并方式

  • 垂直合并

  • 水平合并

  • 对角线合并

  • 紧凑合并

API

        var sprites = new AutoSprites({
            data: cssData, /*合并的CSS的数据*/
            root: '/', /*image的root*/
            path: path.join(process.cwd(), config.target, 'img'), /*image存放路径*/
            fileName: fileName, /*文件名称,针对该名称进行base64编码生成图片的名称*/
            base64: false /*是否启用base64编码*/
        });
        

CSS书写要求

由于无法解析组合类,所以建议图片和样式书写在一个样式里面,另外无法找到的图片将被忽略。

更新日志

  • 2014-04-22 : 修复注释解析错误的问题,修复sprites命令base64参数解析的问题

  • 2014-01-21 : 修复windows下路径替换错误的问题

  • 2013-11-19 :修复注释解析错误的问题

FAQs

Package last updated on 01 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc