Código que acompaña al video Ejecutar Python desde Node.js
Script de Node.js que ejecuta un script de Python. script_node.js invoca a script_python.py como un subproceso utilizando la función spawn. Se establece una comunicación mediante stdin/stdout donde script_node.js envía un texto simple a script_python.py
This file contains hidden or 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 { Pipe, PipeTransform } from '@angular/core'; | |
| @Pipe({ | |
| name: 'password' | |
| }) | |
| export class PasswordPipe implements PipeTransform { | |
| transform(value: string, hide: boolean = true): any { | |
| return !hide ? value.replace(/./g, '*') : value; |
This file contains hidden or 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 mysql = require('mysql-library'); | |
| const mysql = { | |
| createConnection: () => { | |
| return { | |
| query: (query) => { | |
| return query; | |
| } | |
| } | |
| } | |
| }; |