tore.js
v1.0.6-fixed
Published
Tore is a wrapper of JavaScript that builds off of other npm packages(And JavaScript), making it really easy to use for web servers, discord bots, and more!
Downloads
4
Readme
(fixed a bug where the web server wouldnt work)
Say hello to Tore!
Tore is a packages that builds off of other packages(and makes them easier), making Tore really easy to use for web servers, discord bots, and more!
Table of Contents:
What is included? How do I start? Examples
What is included?
You get:
- A Discord API (discord.js)
- A user input system (prompts)
- A way to make web servers (express)
- A interface for fetching resources on websites (node-fetch)
And more to come in the near future!
How do I start?
Just add this to your code if you want to enable everything:
const tore = require('tore.js')
Or to add specific things (Think of it like Discord's API Intents):
const { /* ANY Module you would like to add here (eg., log, prompt) */ } = require('tore.js')
Examples
ALWAYS CHECK THE GITHUB for the most updated examples!!
Prompt
const { prompt, log } = require('tore.js')
const response = await prompt({
type: 'number',
name: 'value',
message: 'Enter a number',
validate: value => value < 0 ? `Number is less than 0.` : true
});
log(response);
Logger
const { log } = require('tore.js')
log('it works!!!')
var x = 'with variables too!'
log(x)
Fetch
const { fetch, log } = require('tore.js')
fetch('https://github.com/')
.then(res => res.text())
.then(body => log(body));
Colors in terminal
const { log, colors } = require('tore.js')
log(colors.green('i should be green'))
log(colors.america('good old usa!!!'))
Web Server
const { startServer, addServerPage, console } = require('./index.js')
startServer(3000)
addServerPage('/', (req, res) => {
res.send('Hello World')
})
Discord Bot
const { discord } = require('./index.js')
const client = discord()
client.on('ready', () => {
console.log('ready')
})
client.on('message', msg => {
console.log(msg.content)
})
client.login(token)
Go to the discord.js docs for documentation
Classes
Classes in Tore are really easy! Instead of doing this:
const test = class {
constructor () {
this.ping = 'pong'
}
}
console.log(test.ping)
You would do this, which would save alot of time, while doing the same action(s):
const { Class, log } = require('tore.js')
const test = Class;
test.ping = 'pong'
log(test.ping)
Note: OTHER MODULE EXAMPLES NOT INCLUDED HERE CAN BE EASILY FOUND IN THE OFFICIAL node.js docs
Why Tore is easy to learn
- It is based off of JavaScript, which pretty much easy to learn.
- There are alot of other sources of documentation for every single module.
- It's also adds features weekly!