Skip to content
Occam's file system functionality.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
es6
lib
.gitignore
README.md
index.js
package.json

README.md

File system

Occam's file system functionality.

Contents

Introduction

This package provides a consistent interface for the open command line tool's own file and project functionality, as well as providing additional functions to move and remove project entries. Aside from these last two functions, it is unlikely to be of interest to anyone.

Installation

With npm:

npm install occam-file-system

You can also clone the repository with Git...

git clone https://github.com/jecs-imperial/occam-file-system.git

...and then install the necessary modules with npm from within the project's root directory:

npm install

Usage

Look in the es6/ directory for the function signatures. The exported functions are:

  • importProject()
  • saveFiles()
  • saveFile()
  • loadFile()
  • loadFiles()
  • loadProjects()
  • moveProjectEntries()
  • removeProjectEntries()

Typical usage is shown below:

const open = require('occam-open-cli'), ///
      filesystem = require('occam-file-system'); ///

const { Files } = open,
      { loadFiles } = filesystem;

const filePaths = ...,
      projectsDirectoryPath = ...,
      json = {
        filePaths
      };

loadFiles(projectsDirectoryPath, json, function(json) {
 const files = (json !== null) ?
                 Files.fromJSON(json) :
                   null;

  ...
});

Note that you get JSON back, not an instance of the Files class, and that that JSON might be null.

Building

Automation is done with npm scripts, have a look at the package.json file. The pertinent commands are:

npm run build-debug
npm run watch-debug

Contact

You can’t perform that action at this time.