# create-symlink

> Create a symbolic link

Latest version **1.0.0** (published 2017-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-symlink
pnpm add create-symlink
yarn add create-symlink
bun add create-symlink
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-03-17 |
| First published | 2017-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | symlink, symblic, link, file, junction, fs, path, promise, promisified, async |

## Links

- npm: https://www.npmjs.com/package/create-symlink
- Repository: https://github.com/shinnn/create-symlink
- Homepage: https://github.com/shinnn/create-symlink#readme
- Issues: https://github.com/shinnn/create-symlink/issues
- npm.io page: https://npm.io/package/create-symlink

## Dependencies (3)

- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.11
- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^1.1.0
- [inspect-with-kind](https://npm.io/package/inspect-with-kind.md) ^1.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-03-17
- 0.5.0 — 2017-03-06
- 0.4.0 — 2017-03-06
- 0.3.0 — 2017-02-14
- 0.2.0 — 2017-02-10
- 0.1.0 — 2017-02-07
- 0.0.2 — 2017-02-07
- 0.0.1 — 2017-01-30
- 0.0.0 — 2017-01-30

## README

# create-symlink

[![NPM version](https://img.shields.io/npm/v/create-symlink.svg)](https://www.npmjs.com/package/create-symlink)
[![Build Status](https://travis-ci.org/shinnn/create-symlink.svg?branch=master)](https://travis-ci.org/shinnn/create-symlink)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/create-symlink.svg)](https://coveralls.io/github/shinnn/create-symlink?branch=master)

A [Node.js](https://nodejs.org/) module to [create a symbolic link](http://man7.org/linux/man-pages/man2/symlink.2.html)

```javascript
const createSymlink = require('create-symlink');
const {realpathSync} = require('fs');

createSymlink('/where/file/exists', 'where/to/create/symlink').then(() => {
  realpathSync('where/to/create/symlink'); //=> '/where/file/exists'
});
```

## Installation

[Use npm.](https://docs.npmjs.com/cli/install)

```
npm install create-symlink
```

## API

```javascript
const createSymlink = require('create-symlink');
```

### createSymlink(*target*, *path* [, *option*])

*target*: `String` (symlink target)  
*path*: `String` (a path where you create a symlink)  
*option*: `Object`  
Return: [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)

Almost the same as the built-in [`fs.symlink`](https://nodejs.org/api/fs.html#fs_fs_symlink_target_path_type_callback), but:

* [Promisified](https://promise-nuggets.github.io/articles/07-wrapping-callback-functions.html)
* The third parameter receives an object with `type` property, instead of receiving a string directly.

```javascript
createSymlink('src', 'dest', {type: 'junction'}).then(() => {
  // Created a junction point (Windows only)
});
```

## License

Copyright (c) 2017 [Shinnosuke Watanabe](https://github.com/shinnn)

Licensed under [the MIT License](./LICENSE).

---
_Source: https://npm.io/package/create-symlink · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
