https://github.com/linusu/node-alias
Mac OS aliases creation and reading from node.js
https://github.com/linusu/node-alias
Last synced: about 1 year ago
JSON representation
Mac OS aliases creation and reading from node.js
- Host: GitHub
- URL: https://github.com/linusu/node-alias
- Owner: LinusU
- License: mit
- Created: 2014-01-06T20:51:36.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-11-20T13:57:31.000Z (over 1 year ago)
- Last Synced: 2025-03-30T00:10:03.389Z (about 1 year ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 14
- Watchers: 4
- Forks: 23
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-alias
Mac OS aliases creation and reading from node.js
## Attention
This library does currently not handle the `book\0\0\0\0mark\0\0\0\0`-header. It only does manipulation on the raw alias data.
I intend to add something like `alias.write(buf, path)` and `alias.read(path)`.
## Installation
```sh
npm install macos-alias
```
## Usage
```javascript
var alias = require('macos-alias');
```
## API
### alias.create(target)
Create a new alias pointing to `target`, returns a buffer.
(This function performs blocking fs interaction)
### alias.decode(buf)
Decodes buffer `buf` and returns an object with info about the alias.
### alias.encode(info)
Encodes the `info`-object into an alias, returns a buffer.
### alias.isAlias(path)
Check if the file at `path` is an alias, returns a boolean.
(This function performs blocking fs interaction)
## Hacking
Clone the repo and start making changes, run `node-gyp` to build the project.
```sh
node-gyp rebuild
```
## Tests
```sh
mocha
```