class Foo {
private x: number = 0;
getX() {
return this.x;
}
get xPlusOne() {
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 { createServer } from "net"; | |
/** | |
* check if a port is being used (es2015+ ver) | |
* @param port | |
* @returns {Promise<boolean>} | |
*/ | |
export function isPortTaken(port) { | |
return new Promise((resolve, reject) => { | |
const tester = createServer() |
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 { Object2D } from "phina.js"; | |
// 拡張宣言部分: 拡張したいクラス型定義へのパス | |
declare module "phina.js/types/app/object2d" { | |
// プロトタイプ拡張する場合 | |
export interface Object2D { | |
/** | |
* [ここに詳細] | |
*/ |
URLが「localhost~」なら再生できるのに「192.168~」のローカルIP直書きだと再生できないことがある
[GOOD] http://localhost:8000/youtube-sample/index.html
[BAD] http://192.168.11.25:8000/youtube-sample/index.html
再生しようとしても「動画が再生できません」とだけ出る
非同期版、async/awaitを使った例のみ https://github.com/jprichardson/node-fs-extra/tree/d6478d2217c876b917f82ce822fa9068534ae62a/docs
そのままfs.readFile
const fs = require('fs-extra');
const filePath = "./input.txt";
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
/** | |
* phina-classを pure JS class(ES2015class)に変換 | |
* @see https://qiita.com/Negiwine_jp/items/512248cce5d9274cbb83 | |
* @param {phinaclass} phinaClass [description] | |
* @return {function} | |
*/ | |
export function phinaClassConvert(phinaClass) { | |
const creator = function(){ | |
phinaClass.prototype.init.apply(this, arguments) | |
} |
NewerOlder