This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {validate, Contains, IsInt, Length, IsEmail, IsFQDN, IsDate, Min, Max} from "class-validator"; | |
export class Post { | |
@Length(10, 20) | |
title: string; | |
@Contains("hello") | |
text: string; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as path from 'path' | |
import * as ts from 'typescript' | |
const glob = require('glob') | |
const globPattern = path.join(this.projectPath, 'lib/modules/**/usercommands/*.ts') | |
const userCommandFiles = glob.sync(globPattern) | |
// Build a program using the set of root file names in fileNames | |
const program = ts.createProgram(this.userCommandFiles, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "my-game", | |
"description": "Super duper", | |
"version": "0.0.1", | |
"repository": "...", | |
"author": "Marc Trudel <mtrudel@...jp>", | |
"license": "See LICENSE%", | |
"scripts": { | |
"help": " echo 'Display help information (this screen)' && npm run", | |
"mage": " echo 'Run the mage binary' && mage", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install mage --bootstrap --prefix my-project | |
cd my-project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir my-project | |
cd my project | |
npm install mage --bootstrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install mage -- --bootstrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var npmArgs = JSON.parse(process.env.npm_config_argv); | |
if (npmArgs.original.indexOf('--bootstrap') === -1) { | |
process.exit(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir my-project | |
cd my-project | |
BOOTSTRAP=true npm install mage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const num = process.argv[2] | |
const promisify = require('es6-promisify'); | |
function someFunction(callback) { | |
process.nextTick(callback.bind(null, null, new Date())); | |
} | |
async function loop(call) { | |
for (let i = 0; i < num; i+= 1) { | |
await call() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# This file will be used by the different build scripts and tools | |
# to define outputs and destination | |
### GitHub repository | |
# The GitHub repository information will be used when building the | |
# documentation and pushing releases | |
### | |
github: | |
# User or organization name |