Skip to content

djalbat/occam-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

506 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Occam Server

Occam's server side functionality.

Contents

Introduction

The Occam IDE's server functionality.

Installation

With npm:

npm install occam-server

You can also clone the repository with Git...

git clone https://github.com/djalbat/occam-server.git

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

npm install

Usage

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'), ///
      server = require('occam-server'); ///

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

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

Contact

About

Occam's server side functionality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors