Giter VIP home page Giter VIP logo

symlink-dir's Introduction

symlink-dir

Cross-platform directory symlinking

npm version

  • Always uses "junctions" on Windows. Even though support for "symbolic links" was added in Vista+, users by default lack permission to create them
  • Any file or directory, that has the destination name, is renamed before creating the link

Installation

pnpm add symlink-dir

CLI Usage

Lets suppose you'd like to self-require your package. You can link it to its own node_modules:

# from -> to
symlink-dir . node_modules/my-package

API Usage

'use strict'
const symlinkDir = require('symlink-dir')
const path = require('path')

symlinkDir('src', 'node_modules/src')
  .then(result => {
    console.log(result)
    //> { reused: false }

    return symlinkDir('src', 'node_modules/src')
  })
  .then(result => {
    console.log(result)
    //> { reused: true }
  })
  .catch(err => console.error(err))

API

symlinkDir(target, path, opts?): Promise<{ reused: boolean, warn?: string }>

symlinkDir.sync(target, path, opts?): { reused: boolean, warn?: string }

Creates the link called path pointing to target.

Options:

  • overwrite - boolean - is true by default. When false, existing files at dest are not overwritten.

Result:

  • reused - boolean - is true if the symlink already existed pointing to the target.
  • warn - string - any issues that happened during linking (it does mean a failure).

License

MIT Β© Zoltan Kochan

symlink-dir's People

Contributors

crebier-corentin avatar greenkeeper[bot] avatar ksxgithub avatar renovate-bot avatar renovate[bot] avatar zkochan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

symlink-dir's Issues

An in-range update of @types/node is breaking the build 🚨

Version 8.0.45 of @types/node was just published.

Branch Build failing 🚨
Dependency @types/node
Current Version 8.0.44
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • βœ… continuous-integration/appveyor/branch AppVeyor build succeeded Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

Version 7.0.18 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 7.0.17
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details,- ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v4
npm
package.json
  • better-path-resolve ^1.0.0
  • rename-overwrite ^6.0.0
  • @types/node ^20.14.10
  • @types/tape ^5.6.4
  • rimraf ^3.0.2
  • tape ^5.8.1
  • tempy ^1.0.1
  • ts-node ^10.9.2
  • typescript ^5.5.3
  • write-json-file ^4.3.0
  • node >=18.12

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularmaterial). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Version 3.0.0 published with CRLF line endings

symlink-dir is not invokable from command line on macOS if installed with Yarn.
It fails with the following message:
env: node\r: No such file or directory

See this issue: yarnpkg/yarn#5480
Apparently npm auto converts line endings to LF which is why it only fails with Yarn.

Reverting to v2.0.1 fixes this issue for now.

Can confirm that using dos2unix on v3.0.0 files also fixes the problem.

An in-range update of @types/node is breaking the build 🚨

Version 8.0.27 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 8.0.26
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Missing tags on github

I hope this is the right place to ask this question.

Today I got an error in a third party cli tool that uses symlink-dir per npx remotely (npx symlink-dir ...). But since version 6 requires node >= 18 the command suddenly failed. I came here to the Github repo and couldn't find the new release/tag for 6.0. But it is available at npmjs.com.

Now, my question is why there are different versions/tags on Github (https://github.com/pnpm/symlink-dir/tags) compared to npmjs (https://www.npmjs.com/package/symlink-dir?activeTab=versions)?

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.