0.0.1
This commit is contained in:
commit
a64bd3503e
5 changed files with 190 additions and 0 deletions
44
.github/workflow/npm.yml
vendored
Normal file
44
.github/workflow/npm.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Publish to NPM
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
Publish-NPM:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
scope: '@fiusdevelopment'
|
||||
- name: Install dependencies 🔧
|
||||
run: npm ci
|
||||
- name: Publish package on NPM 📦
|
||||
run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
REGISTRY1: 'registry.npmjs.org'
|
||||
REGISTRY2: 'registry=https://registry.npmjs.org/'
|
||||
|
||||
Publish-GitHub-NPM:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@fiusdevelopment'
|
||||
- name: Install dependencies 🔧
|
||||
run: npm ci
|
||||
- name: Publish package on NPM 📦
|
||||
run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GP_TOKEN }}
|
||||
REGISTRY1: 'npm.pkg.github.com'
|
||||
REGISTRY2: '@fiusdevelopment:registry=https://npm.pkg.github.com'
|
2
.npmrc
Normal file
2
.npmrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
//${REGISTRY1}/:_authToken=${NODE_AUTH_TOKEN}
|
||||
${REGISTRY2}
|
61
LICENSE.txt
Normal file
61
LICENSE.txt
Normal file
|
@ -0,0 +1,61 @@
|
|||
FIUS License V1.1
|
||||
----------------------------------------------------------------
|
||||
1. Definitions
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "License"
|
||||
means this document.
|
||||
|
||||
1.3. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Code that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.4. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.5. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
1.6. "The owners"
|
||||
Who own this project
|
||||
|
||||
1.7. "The code" / "The Software" / "The project" / "The idea"
|
||||
It means the product or creation that this document governs (Including the idea).
|
||||
|
||||
------------------------------------------------
|
||||
2. License Grants, Conditions and Limitation
|
||||
|
||||
2.1. Each contributor has ownership of what he creates, no exceptions.
|
||||
It may require the removal of what it creates from the project,
|
||||
the removal may be denied.
|
||||
|
||||
2.2. You can Contribute at the project by request.
|
||||
|
||||
2.3. You can't copy or share the code.
|
||||
|
||||
2.4. You can't get / use this code from here, you have to get a public
|
||||
from a public source.
|
||||
|
||||
2.5. The owners have the full rights and choice what to do of this project,
|
||||
including your contribution.
|
56
index.js
Normal file
56
index.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
const { writeFile, readFile, mkdir } = require('node:fs/promises');
|
||||
const readline = require ('node:readline/promises');
|
||||
const { stdin, stdout } = require('node:process');
|
||||
var readlineSync = require('readline-sync');
|
||||
var name;
|
||||
|
||||
function getTime () {
|
||||
const date_time = new Date();
|
||||
const year = date_time.getFullYear();
|
||||
const month = ("0" + (date_time.getMonth() + 1)).slice(-2);
|
||||
const day = ("0" + date_time.getDate()).slice(-2);
|
||||
const hours = date_time.getHours();
|
||||
const minutes = date_time.getMinutes();
|
||||
const seconds = date_time.getSeconds();
|
||||
return({year, month, day, hours, minutes, seconds})
|
||||
};
|
||||
|
||||
function createLog () {
|
||||
mkdir('./logs', { recursive: true });
|
||||
var time = getTime();
|
||||
name = `${time.year}.${time.month}.${time.day}.${time.hours}.${time.minutes}.${time.seconds}.log`;
|
||||
writeFile(`./logs/${name}`, '');
|
||||
return(name)
|
||||
};
|
||||
|
||||
function log (string) {
|
||||
readFile(`./logs/${name}`, 'utf8')
|
||||
.then(async (err, data) => {
|
||||
if (!data) data = '';
|
||||
data += string + '\n';
|
||||
writeFile(`./logs/${name}`, data);
|
||||
})
|
||||
};
|
||||
|
||||
function cin (question, hide) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
var answer = readlineSync.question(`${question} `, {
|
||||
hideEchoBack: hide || false
|
||||
})
|
||||
return resolve(answer);
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
return resolve('error');
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
async function cout (string) {
|
||||
var time = getTime();
|
||||
string = `[${time.year}.${time.month}.${time.day}-${time.hours}:${time.minutes}:${time.seconds}] | ${String(string)}`
|
||||
console.log(string);
|
||||
log(string);
|
||||
};
|
||||
|
||||
module.exports = { cin, createCin, cout, createLog, log };
|
27
package.json
Normal file
27
package.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "@fiusdevelopment/std",
|
||||
"version": "0.0.1",
|
||||
"description": "Standard module for javascript",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/FIUSDevelopment/std.git"
|
||||
},
|
||||
"keywords": [
|
||||
"std",
|
||||
"standard",
|
||||
"npmjs",
|
||||
"npm",
|
||||
"module",
|
||||
"javascript"
|
||||
],
|
||||
"author": "FIUS Development | Killer Boss Original - EnyGasELuce",
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"bugs": {
|
||||
"url": "https://github.com/FIUSDevelopment/std/issues"
|
||||
},
|
||||
"homepage": "https://github.com/FIUSDevelopment/std#readme"
|
||||
}
|
Loading…
Reference in a new issue