arcadia-main
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-f001a1 • Public • Published

arcadia-main

This is the main module of the arcadia framework. It gives you good API to write providers, plugins and deployers.

Providers

Providers give you collection of methods, properties to work with you application. For example, the DatabaseProvider gives you abstract migration system. But using this one you cannot work any database. You need a low-level provider e.g. driver.

Drivers

After we have abstract providers we need to get access to something, so we use drivers. Driver is a low-level module, though, usually it's default TypeScript file, that work with the database subset.

For example, if you're going to use sqlite3, you'll need to have DatabaseProvider, SQLite3DatabsaseProvider, SQLite3Driver, and the sqlite3 npm package. So, totally we have 3 files and one package. Why so hard to do that?

Reason of using providers and drivers ins't as hard as it looks now. Trully you describe API in the driver and some request api methods in provider. It's really easy.

Configuration

Every module, provider, driver will need some configuration. There's special collection of classes for configuration.

ConfigCollection. This is the directory handler.

Examples


// Create the instance
let collection = new ConfigCollection();

// Read directory and objectize .json files
let dir = collection.handleDirectory('./config', '.json');

// Safe directory fetch
collection.fetch('./config', (file: ConfigCollector) => {
  console.log(file.fullPath, file.parse());
})

ConfigCollector. This is the config file handler. The class let you to manipulate info written to the config file, read and query it.

NOT DONE YET Now it doesn't support write in file.

Examples

// Create instance of ConfigCollector
let databaseConf = new ConfigCollector('./config/database.json');
// Query database.json
databaseConf.query('users[3].credentials.user');

/arcadia-main/

    Package Sidebar

    Install

    npm i arcadia-main

    Weekly Downloads

    1

    Version

    0.0.1-f001a1

    License

    MIT

    Unpacked Size

    94 kB

    Total Files

    60

    Last publish

    Collaborators

    • ramiqk