Skip to content

LukNasc/shold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shold

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

Versions

Changelog

Adding new functions

  • createFile - Write your own commands
  • createFile - Write your own commands with custom privileges

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

functions Args description
createDirectory paht, name create a new directory
createDirectory {name, path, privileges:{user, password}} create a new directory with another privileges
changeDirectory path change directory
changeDirectory {path, privileges:{user,password}} change directory with another privileges
createFiles name.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
rawCommand command write your own commands
rawCommandWithPrivileges command, privileges:{user, password} write your own commands with another privileges

License

MIT

Developer

Lucas Nascimento

About

Run linux command lines within a NodeJS application

Resources

License

Stars

Watchers

Forks

Packages

No packages published