occam-file-system
v6.0.505
Published
Occam's file system functionality.
Readme
Occam File System (soon to be Occam Server)
The Occam IDE's server functionality.
Contents
Introduction
The Occam IDE's server functionality.
Installation
With npm:
npm install occam-file-systemYou can also clone the repository with Git...
git clone https://github.com/djalbat/occam-file-system.git...and then install the dependencies with npm from within the project's root directory:
npm installUsage
The exported functions are:
loadFile()saveFile()loadFiles()loadProject()loadRelease()loadProjects()loadReleases()removeRelease()moveProjectEntries()removeProjectEntries()renameProjectEntries()createProjectEntries()
Soem utility functions are also exported. See the source for details.
Typical usage is as follows:
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 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