1. shelljs-plugin-open
An example shelljs-plugin to open a file with its default application
shelljs-plugin-open
Package: shelljs-plugin-open
Created by: shelljs
Last modified: Sun, 26 Jun 2022 18:48:20 GMT
Version: 0.2.1
License: MIT
Downloads: 2,413
Repository: https://github.com/shelljs/plugin-open

Install

npm install shelljs-plugin-open
yarn add shelljs-plugin-open

shelljs-plugin-open

Build Status
npm
shelljs-plugin

A ShellJS plugin for the open() command
to open a file (or URL) with its default application. This is largely based on
opener.

This is designed to imitate the open command on Mac OS X. Here's the
equivalent commands for other systems:

  • Mac OS X

     $ open file.txt # opens in a text editor
    
  • Linux

     $ xdg-open file.txt # opens in a text editor
    
  • Windows

    > start file.txt
    

Installation

 $ npm install --save shelljs
$ npm install --save shelljs-plugin-open

Usage

ShellJS unofficially has the capacity for plugins (the API is likely to change a
bit) since v0.7.1. Although we don't recommend developing for this yet, this
plugin is designed to test that API, and we will adapt it along with changes to
ShellJS up until official plugin support. To use this plugin, you must use
exactly version v0.7.1 (although, eventually this will support v1.0.0+).

To use this plugin in your project, include it like so:

 var shell = require('shelljs');
require('shelljs-plugin-open');

// Ex. usage:
shell.open('file.txt'); // the plugin is now available!

Supported systems

  • Linux (all variants)
  • OS X
  • Windows

This is supported for Node v0.11+

Writing plugins

If you're interested in taking a look at the current state of the plugin API,
take a look at index.js. This has helpful comments explaining the
necessary boilerplate for writing a plugin. For an example usage of the plugin,
take a look at test/test.js.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin