1.2.0 • Published 3 years ago

syl.js v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Getting Started with Syl

Installing syl.js:

  • Open a new Terminal or Command Prompt.
  • Enter the following command:
npm i syl.js

Notice

As of syl.js@1.1.0, only the WebSyl supports previous versions.

If you are using the PublicSyl (or just Syl) or the PrivateSyl, you will not be able to send data without being on the latest syl.js version. This is due to API incompatibility errors.

You will still be able to receive data from these two tools from this version and above. You will not be able to retrieve data while using any version before @1.1.0.

Changelog

syl.js@1.0.1

  • Fixed importing issues.

syl.js@1.0.2

  • Fixed an issue with the WebSyl#setRoute() method for POST requests.

syl.js@1.1.0

  • Added the PrivateSyl.
    • The PrivateSyl class requires a password to use a Syl. If you'd like a Password, please join the Discord Server shown at the bottom of the page and open a ticket.
  • Modified the Syl to require the usage of methods, rather than setting variables.
    • Syl#setToken(), PrivateSyl#setToken(), and PrivateSyl#setPassword().

syljs@1.2.0

  • Updated API Version.

Syl Types

PublicSyl (or just Syl)

  • A basic form of API utility that allows you to communicate between two different scripts.
  • A Web Server is already set up for all Syl instances, and you can access them through tokens.
  • Anyone can modify the data of any token on a PublicSyl. Be careful with this.

PrivateSyl

  • A simple modification to the PublicSyl to require a Syl to have a password.
  • PrivateSyls are given upon request; not given upon immediate access.
    • If you would like access, please join the Discord Server at the bottom of the page and open a ticket.

WebSyl

  • A basic form of Web API that allows you to communicate between web servers.

Examples

PublicSyl

Sending data with PublicSyl

const Syl = require("syl.js");
const syl = new Syl();

syl.setToken("example_token");
syl.send("Hello world!");

Receiving data with PublicSyl

const Syl = require("syl.js");
const syl = new Syl();

syl.setToken("example_token");
syl.read((response) => {
  console.log(response); // expected output: Hello world!
});

PrivateSyl

Note: You must have a Private Syl Instance set up to use this.

Sending data with PrivateSyl

const { PrivateSyl } = require("syl.js");
const syl = new PrivateSyl();

syl.setToken("example_token");
syl.setPassword("hello_world");

syl.send("hello world");

Receiving data with PrivateSyl

const { PrivateSyl } = require("syl.js");
const syl = new PrivateSyl();

syl.setToken("example_token");
syl.setPassword("hello_world");

syl.read((response) => {
    console.log(response); // expected output: hello world
});

WebSyl

Sending data with WebSyl

const { WebSyl, RequestType } = require("syl.js");
const syl = new WebSyl({ port: 80 });

syl.setUpRoute("/", RequestType.GET, { successful: true });
syl.setUpRoute("/data", RequestType.POST, (body, respond) => {
    const { string } = body;
    console.log(string); // expected output: hello world

    respond("Successful!");
    // Syl has an automated response of Successful! that can be overridden.
    // The respond() method is not necessary in your code.
});

Receiving data with WebSyl

const { WebSyl } = require("syl.js");
const syl = new WebSyl({ domain: "https://yourdomain.com" });
// Instead of providing the "port" parameter, you can provide the "domain" parameter to change the type of WebSyl being used.

syl.get("/", (data) => {});
syl.post("/", { string: "hello world" });

Future Plans

  • Introduce the UPDATE Request Type.
  • Introduce the DELETE Request Type.
  • Introduce the DATA CACHE for the Syl and WebSyl.

Dependencies

  • express@4.18.1
    • Express allows the WebSyl to create a barebones API system.
  • atils@1.2.6
    • atils allows us to send out fancy looking errors, log them in your computer, and allows the RequestTypes Enum to function.

Need Help?

If you need some assistance with syl.js, contact me @ contact@itsatelo.com.I'll assist you when I can.

Little Notice

syl.js will be updating to atils@2.0.0 when it releases. I'll have to go through and change a lot of things, but I'd rather use it than not. I still don't have a release date for atils@2.0.0 though.

Getting Your Own PrivateSyl

To get a PrivateSyl, join the Discord Server here, and DM the Setrius Development bot to open a support ticket.

Your Discord username and tag will not be shown to our Support Team, nor will you be able to view the Support Team Member's username and tag.

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1-f

3 years ago

1.0.1

3 years ago

1.0.0-f

3 years ago

1.0.0-a

3 years ago

1.0.0

3 years ago

0.0.1-pre.2

3 years ago

0.0.1-pre.1

3 years ago