Giter VIP home page Giter VIP logo

node-mac-alias-resolver's Introduction

Alias Resolver for Node

MacOS has had a concept of Aliases since System 7. These work a little like symbolic links, a little like hard links, but basically appear to be empty files to command-line applications.

Since I need to figure out where these links point to, I created this node module. For obvious reasons, it will only work on macOS.

This module now also allows the creation of alias files, and includes two bin/ utilities.

Usage

Given a file at /Users/foo/file that has an alias /Users/foo/Documents/doc:

const aliasResolver = require('alias-resolver').default;
const resolvedFile = aliasResolver('/Users/foo/file'); 
//resolvedFile is /Users/foo/Documents/doc

const anotherResolvedFile = aliasResolver('/Users/foo/notAnAlias');
//anotherResolvedFile is null

const createAlias = require('alias-resolver').createAlias;
createAlias('/usr/bin/ls', './ls-alias');

Global Usage

Alias files are tricky to deal with on the command-line. This module now includes two helpers to make things easier.

  > npm -g install alias-resolver
  > create-alias /usr/bin/ls ./ls-alias
  > resolve-alias ls-alias
  /usr/bin/ls

node-mac-alias-resolver's People

Contributors

benb avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

node-mac-alias-resolver's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.