In the root of your project, add .gitlab-ci.yml with the configuration below.
image: node:latest
stages:| // zod schema | |
| z.object({ | |
| // valid if string or: | |
| optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
| nullable: z.string().nullable(), // field explicitly `null` | |
| nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
| }); | |
| // type | |
| { |
| #!/bin/sh | |
| /Applications/Discord.app/Contents/MacOS/Discord --proxy-server=http://po.cc.ibaraki-ct.ac.jp:3128 |
| 'use strict'; | |
| /** | |
| * @callback BeforeShutdownListener | |
| * @param {string} [signalOrEvent] The exit signal or event name received on the process. | |
| */ | |
| /** | |
| * System signals the app will listen to initiate shutdown. | |
| * @const {string[]} |
| import { Module } from '@nestjs/common'; | |
| import { HttpModule } from './http/http.module'; | |
| import { FooModule } from './foo/foo.module'; | |
| @Module({ | |
| imports: [ | |
| HttpModule, | |
| FooModule, // <- we'll make use of the "augmented" HttpService in this module | |
| ], |
| import { IncomingMessage } from 'http' | |
| import { | |
| NextApiRequestCookies, | |
| NextApiRequestQuery, | |
| } from 'next/dist/next-server/server/api-utils' | |
| import { Socket } from 'net' | |
| import { ServerResponse } from 'http' | |
| import { NextApiRequest, NextApiResponse } from 'next' | |
| import { Env } from 'next/dist/lib/load-env-config' |
| // These hashes are for algorithmic use cases, such as bucketing in hashtables, where security isn't | |
| // needed and 32 or 64 bits is enough (that is, rare collisions are acceptable). These are way simpler | |
| // than sha1 (and all its deps) or similar, and with a short, clean (base 36 alphanumeric) result. | |
| // A simple, *insecure* 32-bit hash that's short, fast, and has no dependencies. | |
| // Output is always 7 characters. | |
| // Loosely based on the Java version; see | |
| // https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript | |
| const simpleHash = str => { | |
| let hash = 0; |
code: https://github.com/zmts/supra-api-nodejs
Одной из болезней Node.js комьюнити это отсутствие каких либо крупных фреймворков, действительно крупных уровня Symphony/Django/RoR/Spring. Что является причиной все ещё достаточно юного возраста данной технологии. И каждый кузнец кует как умеет ну или как в интернетах посоветовали. Собственно это моя попытка выковать некий свой подход к построению Node.js приложений.
| let providerHandler = { | |
| get: async(target, name) => { | |
| console.log('load someting from remote...') | |
| return new Promise( (res, rej) => { | |
| setTimeout(() => res(42), 4200) | |
| }) | |
| }, | |
| set: function (obj, prop, value) { | |
| return new Promise((res, rej) => { |