1.0.4 • Published 3 years ago

shold v1.0.4

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

Shold

Shold is a lib node js for running linux commands with js.

Versions

Changelog

Adding new features to existing functions

  • Running createDirectory function with privileges
  • Running changeDirectory function with privileges

Adding new functions

  • rawCommand - Write your own commands
  • rawCommandWithPrivileges - Write your own commands with custom privileges
  • createFile - create files with function very easy

Usage

Start by importing the dependency into the file you want to use it

import * as shold from 'shold';

//or 

const shold = require('shold');

After importing, we can now use the functions that the package provides

createDirectory (mkdir ...)

//Create a directory
const result = await shold.createDirectory("path", "directory name");

//or

//Create a directory with custom privileges
const result = await shold.createDirectory({
    path: "path",
    name: "directory name",
    privileges: {
        user: "User",
        password: "password"
    }
});

changeDirectory (cd ...)

    const result = await shold.changeDirectory("path");

    //or

    const result = await shold.changeDirectory({
        path: "path",
        privileges: {
            user: "user",
            password: "password"
        }
    });

Create files

    const result = await shold.createFile("nome.txt");

    //or 
****
    const result = await shold.createFile({
        fileNameWithExtension: "nome.txt",
        privileges: {
            user: 'user',
            passowrd: 'password'
        }
    });

All functions below

functionsArgsdescription
createDirectorypaht, namecreate a new directory
createDirectory{name, path, privileges:{user, password}}create a new directory with another privileges
changeDirectorypathchange directory
changeDirectory{path, privileges:{user,password}}change directory with another privileges
createFilesname.txt (parse file`s name with extension) | create a file with name passed
createFiles{fileNameWithExtension, privileges:{user, password}}create a file with name with another privileges
rawCommandcommandwrite your own commands
rawCommandWithPrivilegescommand, privileges:{user, password}write your own commands with another privileges

License

MIT

Developer

Lucas Nascimento

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago