Occam's file system functionality.
npm install occam-file-systemThe Occam IDE's server functionality.
- Introduction
- Installation
- Usage
- Building
- Contact
The Occam IDE's server functionality.
With npm:
npm install occam-file-system
You 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 install
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.
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
* james.smith@djalbat.com