# make-symlinks

> Create symbolic link (file symlink) using glob

Latest version **2.0.1** (published 2018-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install make-symlinks
pnpm add make-symlinks
yarn add make-symlinks
bun add make-symlinks
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2018-12-17 |
| First published | 2016-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 3 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Guntur Poetra |
| Maintainers | guntur |
| Keywords | create, glob, link, links, ln, make, symbolic, symlinks, tool, unlink, utility, wildcard |

## Links

- npm: https://www.npmjs.com/package/make-symlinks
- Repository: https://github.com/iguntur/make-symlinks
- Homepage: https://github.com/iguntur/make-symlinks#readme
- Issues: https://github.com/iguntur/make-symlinks/issues
- npm.io page: https://npm.io/package/make-symlinks

## Dependencies (3)

- [del](https://npm.io/package/del.md) ^3.0.0
- [pify](https://npm.io/package/pify.md) ^4.0.1
- [globby](https://npm.io/package/globby.md) ^8.0.1

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2018-12-17
- 2.0.0 — 2018-12-17
- 1.1.0 — 2018-03-06
- 1.0.0 — 2016-11-15
- 0.1.2 — 2016-10-27
- 0.1.1 — 2016-10-27
- 0.1.0 — 2016-10-27

## README

# make-symlinks

[![Travis CI](https://img.shields.io/travis/iguntur/make-symlinks.svg?style=flat-square)](https://travis-ci.org/iguntur/make-symlinks)
[![node](https://img.shields.io/node/v/make-symlinks.svg?style=flat-square)](#)
[![npm](https://img.shields.io/npm/v/make-symlinks.svg?style=flat-square)](https://www.npmjs.org/package/make-symlinks)
[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-1e9eff.svg?style=flat-square)](http://makeapullrequest.com)

> Create symbolic link (file symlink) using glob

---

## Install

```console
$ npm install make-symlinks
```


## Usage

```js
const makeSymlinks = require('make-symlinks');

const patterns = ['/home/guntur/dotfiles/*', '!/home/guntur/dotfiles/.git'];
const path = '/home/guntur/';

makeSymlinks(patterns, path).then(symlinks => {
    symlinks.forEach(symlink => {
        console.log(symlink.path, '→', symlink.target);
    });
});

const symlinks = makeSymlinks.sync(patterns, path);
symlinks.forEach(symlink => {
    console.log(symlink.path, '→', symlink.target);
});
```


## API

### makeSymlinks(`patterns`, `path`, `[options]`)

- Params:
    - `patterns`: `<string | string[]>` _(required)_ - The source files. See [`globby`](https://github.com/sindresorhus/globby#patterns) supported patterns.
    - `path`: `<string>` _(required)_ - The directory an output of symlink(s).
    - `options`: [`<Options>`](#options)
- Returns: `<Promise<object>>` - Returns a promise for an array object of symlinks patterns and path.

### makeSymlinks.sync(`patterns`, `path`, `[options]`)

- Params:
    - `patterns`: `<string | string[]>` _(required)_ - The source files. See [`globby`](https://github.com/sindresorhus/globby#patterns) supported patterns.
    - `path`: `<string>` _(required)_ - The directory an output of symlink(s).
    - `options`: [`<Options>`](#options)
- Returns: `<Promise<object>>` - Returns an array object of symlinks patterns and path.


#### Options

See all supported [`globby`](https://github.com/sindresorhus/globby#options) options.

- `cwd`: `<string>` _(optional)_ - The source files to resolve from.
    - Default: `process.cwd()`
- `force`: `<boolean>` _(optional)_ - Delete symlink if exists.
    - Default: `false`
- `dryRun`: `<boolean>` _(optional)_ - See what would be created symlinks.
    - Default: `false`

**Example**
```js
const options = {
    cwd: process.env.HOME,
    dryRun: true
};

makeSymlinks('**/*', '/path/symlinks/dest', options).then(symlinks => {
    symlinks.forEach(symlink => {
        console.log(symlink.path, '→', symlink.target);
    });
});
```



## Related

- [ln-cli](https://github.com/iguntur/ln-cli) - Create or delete symbolic link using glob on CLI.
- [del-symlinks](https://github.com/iguntur/del-symlinks) - Delete symlinks using glob.
- [get-symlinks](https://github.com/iguntur/get-symlinks) - Get all symbolic link (file symlinks) using glob.


## License

MIT © [Guntur Poetra](https://github.com/iguntur)

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