npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

symlink-resolver-fork

v0.2.1-fork.1

Published

Simple tool for replacing symlinks by real files and vice versa.

Downloads

330

Readme

Symlink Resolver

This tool allows to replace symbolic links by real files in given directory and revert the changes back to symlinks. All the magic in a simple cli command!

Installation

npm install symlink-resolver --save-dev

Node.js v6.4+ and POSIX-standarized operating system are required.

To your package.json scripts section add the following rule:

"scripts": {
    "symlink-resolver": "symlink-resolver",
}

Basic Usage

For fast usage you can simply run:

  • npm run symlink-resolver build ./symlinks/path to replace symlinks by real files in ./symlinks/path
  • npm run symlink-resolver clear ./symlinks/path to restore all symlinks

First command will create ./symlinks/path/.symlinks.json file which contains changes that have been made in this directory. It will be removed by the second command, however you can still add to your .gitignore the following rule: .symlinks.json

How to create a symlink?

Use ln -s target source command, i.e.:

ln -s ../../source/path/linked-dir ./project/src/linked-dir

Advanced usage

If you need this feature to make a build, then I strongly recommend to automatize your building process:

"scripts": {
        "symlink-resolver": "symlink-resolver",
        "prebuild": "npm run symlink-resolver build ./symlinks/path",
        "postbuild": "npm run symlink-resolver clear ./symlinks/path",
        "build": "your build command should be under this name"
}

This way you will be able to make a build and edit your files without worries.

However, in some cases like emulating a device, the "post" script will not be executed. If this is also your case then take a look at example workaround for NativeScript:

  "scripts": {
    "symlink-resolver": "symlink-resolver",
    "prens-bundle": "npm run symlink-resolver build ./symlinks/path",
    "delay-clear": "sleep 22 && npm run symlink-resolver clear ./symlinks/path",
    "ns-bundle": "npm run delay-clear | ns-bundle",
    "start-android-bundle": "npm run ns-bundle --android --start-app",
    "start-ios-bundle": "npm run ns-bundle --ios --start-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  },

Advanced configuration

You can adjust Config to your needs.

  • Want to use custom symlinks file name? No problem, just set Config.symlinksFile to whatever you want.
  • Need some custom behavior? Simply extend SymlinkHelper class and set Config.helperClass to yours.
export interface ConfigInterface {
    rootDir: string;
    symlinksFile: string;
    helperClass: typeof SymlinkHelper;
}
Happy developing!