1
Fork 0

Revert readme changes I have imported from the wrong place

This commit is contained in:
prescientmoon 2024-05-28 03:35:22 +02:00
parent 2dbc7a3a4c
commit 8bb0c4fd2f
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
5 changed files with 36 additions and 17 deletions

View file

@ -1,30 +1,35 @@
# 🚧 This repo has been moved to [prescientmoon/Mongy](https://github.com/prescientmoon/Mongy) 🚧
# Mongy # Mongy
A high level interface for MongoDB built on top of Mongoose
A high level interface for MongoDB built on top of Mongoose
#Get started: #Get started:
To get started, first install the package: To get started, first install the package:
``` ```
npm install mongy npm install mongy
``` ```
Then you need to include it in your script: Then you need to include it in your script:
``` ```
const Mongy = require("mongy"); const Mongy = require("mongy");
``` ```
The next step is to create an instance of the Mongy class: The next step is to create an instance of the Mongy class:
``` ```
const mydb = new Mongy(); const mydb = new Mongy();
``` ```
To connect to your datebase you need to call the 'connect' method: To connect to your datebase you need to call the 'connect' method:
``` ```
mydb.connect(process.env.DBURL); mydb.connect(process.env.DBURL);
``` ```
To create your first model call createModel(name,collection,schema): To create your first model call createModel(name,collection,schema):
``` ```
mydb.createModel("User","users",{ mydb.createModel("User","users",{
name:String, name:String,
@ -33,6 +38,7 @@ mydb.createModel("User","users",{
``` ```
To make an instance of the model call 'instantiate(name,data)': To make an instance of the model call 'instantiate(name,data)':
``` ```
async function addUser(name,email){ async function addUser(name,email){
const myNewUser = mydb.instantiate("User",{name,email}); const myNewUser = mydb.instantiate("User",{name,email});
@ -40,6 +46,7 @@ async function addUser(name,email){
``` ```
And then to save your model call the function 'saveModel': And then to save your model call the function 'saveModel':
``` ```
async function addUser(name,email){ async function addUser(name,email){
... ...
@ -48,6 +55,7 @@ async function addUser(name,email){
``` ```
Then you can get the data of your user via the '.find(name,data)' method: Then you can get the data of your user via the '.find(name,data)' method:
``` ```
async function getUsers(name){ async function getUsers(name){
return await mydb.find("User",{name}); return await mydb.find("User",{name});

View file

@ -1 +0,0 @@
# 🚧 This repo has been moved to [prescientmoon/quizz-hack](https://github.com/prescientmoon/quizz-hack) 🚧

View file

@ -1,11 +1,11 @@
# 🚧 This repo has been moved to [prescientmoon/ultra32](https://github.com/prescientmoon/ultra32) 🚧
# Ultra32 # Ultra32
A vector package using the fast float32array
A vector package using the fast float32array
# Get started: # Get started:
To get started, install ultra32: To get started, install ultra32:
``` ```
npm install ultra32 --save npm install ultra32 --save
``` ```
@ -17,6 +17,7 @@ const vec = new Float32Array([0,0]);
``` ```
You can perform multiple operations: You can perform multiple operations:
``` ```
add(vec,new Float32Array([1,2])); add(vec,new Float32Array([1,2]));
mul(vec,3); mul(vec,3);

View file

@ -1,2 +0,0 @@
# 🚧 This repo has been moved to [prescientmoon/Four.js](https://github.com/prescientmoon/Four.js) 🚧
# Four.js

View file

@ -1,33 +1,41 @@
# 🚧 This repo has been moved to [prescientmoon/Translucid](https://github.com/prescientmoon/Translucid) 🚧
# Translucid # Translucid
A simple node.js library to bind files to requests A simple node.js library to bind files to requests
# Get started: # Get started:
First you need to install the package: First you need to install the package:
``` ```
npm install translucid --save npm install translucid --save
``` ```
Then, you need to include it in your project: Then, you need to include it in your project:
``` ```
const trans = require("translucid"); const trans = require("translucid");
``` ```
To create your first server, call ".QuickServer(port)": To create your first server, call ".QuickServer(port)":
``` ```
trans.QuickServer(8000); trans.QuickServer(8000);
``` ```
The ".QuickServer" method return many useful objects: The ".QuickServer" method return many useful objects:
``` ```
const {app,server,connect,translucid} = trans.QuickServer(8000); const {app,server,connect,translucid} = trans.QuickServer(8000);
``` ```
The translucid object can be used to make file bindings: The translucid object can be used to make file bindings:
``` ```
translucid.bind("/","client/index.html",["myId"]); translucid.bind("/","client/index.html",["myId"]);
``` ```
Then you can add middleware like this: Then you can add middleware like this:
``` ```
translucid.use({ translucid.use({
name:"my middleware", name:"my middleware",
@ -38,17 +46,20 @@ translucid.use({
}); });
``` ```
You can make a folder public like this: You can make a folder public like this:
``` ```
translucid.public(`client`); translucid.public(`client`);
``` ```
You can read bindings from a file: You can read bindings from a file:
``` ```
translucid.bindJSON(`data/files.json`); translucid.bindJSON(`data/files.json`);
``` ```
And in files.json: And in files.json:
``` ```
{ {
"/articles":{ "/articles":{
@ -67,11 +78,13 @@ And in files.json:
``` ```
The QuickServer returns: The QuickServer returns:
* translucid => the basic translucid object
* express => the express module - translucid => the basic translucid object
* http => the http module - express => the express module
* server => instance of http.Server() - http => the http module
* connect => a promise that resolves when the server is listening to the specified port - server => instance of http.Server()
- connect => a promise that resolves when the server is listening to the specified port
Other utilities in translucid: Other utilities in translucid:
* read => read a file
- read => read a file