brizer / sym-lnk

a tool to create or del symbolic link

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sym-lnk

Manage symbolic links based on aliases.

Install

$ npm install sym-lnk

Usage

const symlink = require("sym-lnk");

symLink.addSymlink({
  configs: [
    {
      path: "/Users/liufang/Neteasework/front-study",
      alias: "front-study"
    },
    {
      path: "/Users/liufang/Neteasework/front-study-web",
      alias: "front-study-web"
    },
    {
      path: "/Users/liufang/Neteasework/front-study-cp",
      alias: "front-study-cp"
    }
  ]
});

symLink.rmSymlink({
  configs: [
    {
      path: "/Users/liufang/Neteasework/front-study",
      alias: "front-study"
    },
    {
      path: "/Users/liufang/Neteasework/front-study-web",
      alias: "front-study-web"
    },
    {
      path: "/Users/liufang/Neteasework/front-study-cp",
      alias: "front-study-cp"
    }
  ]
});

API

addSymlink

add symbolic links according to configuration in current path.

  • config (Array)

    • path:symbolic target path
    • alias: symbolic source alias
  • force (Boolean) if symbolic link is exists,delete it and reconstruct.

rmSymlink

remove symbolic links according to configuration in current path.

  • config (Array)

    • path:symbolic target path
    • alias: symbolic source alias

Want to contribute?

Any idea to improve this project would be greatly appreciated.

About

a tool to create or del symbolic link


Languages

Language:JavaScript 100.0%