Giter Site home page Giter Site logo

zhangaz1 / folder-manager Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14 KB

This folder manager serves, as the name implies, to read, write, list, transform, clone, filter and display the contents of folders. All his methods are synchronous.

Home Page: https://www.npmjs.com/package/folder-manager

JavaScript 100.00%

folder-manager's Introduction

Bannière

Folder Manager

What is it ?

This folder manager serves, as the name implies, to read, write, list, transform, clone, filter and display the contents of folders. All his methods are synchronous.

"Based on simplicity because we are human"

How to install ?

Open a console, go to your project folder with cd and type the following command.

npm install folder-manager

What does this package contain ?

Parameters :

  • item represents a file object or a folder object.
  • folder represents a folder object.
  • file represents a file object.
  • outputType denotes the typing of the expected value in return. He can be object, array and string.
  • existingPath is nothing more than an existing full path.
  • newPath is a new path commonly requested when creating a folder or a file.
  • encoding is simply the encoding code for reading and writing files.
  • json is just a stringable object. View the docs.
  • Parameters whose names end with a question mark are Booleans. They simply ask whether or not the method cited by the parameter will be applied.
  • The {} symbolize a function, what is inside are its possible arguments

Classes and functions :

Native functions

  • function simplify( item [, outputType ])
    • returns : (Array[ Array || String] || Object || String) || false
  • function read( existingPath [, encoding ])
    • returns : (File || Object) || false
  • function write( item, newPath )
  • function readFolder( existingPath [, filter{ name, ext, item } [, encoding ]])
    • returns : Folder || false
  • function readFile( existingPath [, encoding ])
    • returns : File || false
  • function copyFolder( existingPath, newPath [, filter{ name, ext, item } [, encoding ]])
    • returns : Folder
  • function copyJSON( json [, replacer{ key, value } [, reviver{ key, value } ]])
    • returns : Object

Class File

  • function write( newPath )
  • function read( existingPath [, encoding ])
    • returns : this
  • function simplify()
    • returns : String
  • function toString()
    • returns : String
  • function toJSON([ simplify? ])
    • returns : Object
  • const path => Full path => String
  • const fullname => Full file name => String
  • const ext => File extession => String
  • const type => Type of item => "file" || "unread file"
  • const name => File name => String
  • var content => File content => String

Class Folder

  • function write( newPath )
  • function read( existingPath [, filter [, encoding ]])
    • returns : this
  • function forEach( function{ item } )
  • function map( substitute{ item } )
    • returns : Array[ ?]
  • function find( filter{ item } [, findAll? ])
    • returns : (Folder || File) || Array[ File || Folder] || undefined
  • function values( filter{ item } )
    • returns : Array[ File || Folder]
  • function keys( filter{ item } )
    • returns : Array[ String]
  • function entries( filter{ item } )
    • returns : Array[ Array]
  • function files( filter{ item } )
    • returns : Array[ File]
  • function folders( filter{ item } )
    • returns : Array[ Folder]
  • function simplify( [ outputType ])
    • returns : (Array[ Array || String] || Object || String) || false
  • function toString()
    • returns : String
  • function toJSON([ simplify? ])
    • returns : Object
  • function toArray()
    • returns : Array
  • function copyJSON( json [, replacer{ key, value } [, reviver{ key, value } ]])
    • returns : Object
  • const path => Full path => String
  • const fullname => Full folder name => String
  • const type => Type of item => "folder" || "unread folder"
  • const name => File name => String
  • var content => Folder content => String

How to use ?

// A complete demonstration will be there soon

Bannière

folder-manager's People

Contributors

ghomkrosmonaute avatar

Watchers

 avatar

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.