ds_store在写html力的作用,ds-store-JavaScript中文网-JavaScript教程资源分享门户

undefined

node-ds-store

.DS_Store manipulation and creation from node.js

Status

Currently the implementation uses a pre-created .DS_Store file

which it then modifies to suit the needs. This places several

limitations and also only allows creating new files from scratch.

Installation

npm install ds-store

Usage

var DSStore = require('ds-store');

var file = new DSStore();

API

file.setBackgroundPath(path)

Set the background image to file specified by path.

file.setBackgroundColor(red, green, blue)

Set the background color to the color specified by three floats between 0 and 1.

file.setIconSize(size)

Set the size of all icons in the folder to size.

file.setIconPos(name, x, y)

Position a file icon for file named name at x, y.

file.setWindowPos(x, y)

Set the Finder window position to x, y.

file.setWindowSize(w, h)

Set the Finder window size to w, h.

file.vSrn(value)

Set the vSrn value to either 0 or 1.

Effect currently unknown.

file.write(path, cb)

Write the .DS_Store information to file at path.

cb will get called with err upon file creation.

Future

I have started work on a Buddy Allocator and B-Tree implementation,

but there is still lots of work required. Having theese would make

it easy to both read and manipulate files. It also wouldn't require

shipping a DSStore-clean file.

Thanks

A special thanks to Wim Lewis who have written a complete implementation

in perl. His documentation of the file format helped me very much.

Repository

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值