Install node 10.16.0 or 12.3.1 from https://nodejs.org
The easiest way is to install the rakudo package from npm
mkdir tutorial-project # Create a fresh project directory
for 99...1 -> $bottles { | |
sing $bottles, :wall; | |
sing $bottles; | |
say "Take one down, pass it around"; | |
sing $bottles - 1, :wall; | |
say ""; | |
} | |
#| Prints a verse about a certain number of beers, possibly on a wall. | |
sub sing( |
Time: <span id="clockDisplay"></span> |
my $precompiled_tests = 't/precompiled'.IO; | |
mkdir($precompiled_tests); | |
for @*ARGS.map(*.IO) -> $file { | |
my $name-part = $file.relative($file.parent.parent).IO; | |
my $module = $file.basename.IO.extension('', :parts(0..*)); | |
if ($module ~~ /^\d/) { | |
$module = 'module_' ~ $module.Str; |
Q::Block.new(Q::Statement::Expr.new(Q::Postfix::Call.new( | |
Q::Identifier.new("say"), | |
Q::Literal::Str.new("OH HAI") | |
))); | |
block { | |
expr { | |
call { | |
identifier "say"; | |
str "OH HAI"; |
async function bottom() { | |
console.log('in bottom'); | |
const stack = new Error().stack; | |
console.log('stack:', '<<<' + stack + '>>>'); | |
console.log(typeof stack); | |
console.trace('stack trace'); | |
} | |
async function middle() { | |
await bottom(); |
const array = [0,1,2,3,4,5,6]; | |
array.shift(); | |
array.shift(); | |
array.shift(); | |
array[3] = '_set_'; | |
array[10] = '_set_'; | |
console.log('atpos', array.map(x => x.toString()).join(',')); |
use lib 'nodejs#' ~ $*PROGRAM.parent.add('node_modules').absolute; | |
use chalk:from<node.js>; | |
say("Hello {chalk.blue("Blue")} World"); |
<html> | |
<head> | |
<script defer src="spaceship.p6"></script> | |
</head> | |
<body style='background-color: blue'> | |
<canvas id='spaceship' height='500' width='500' style='border: 1px pink;'></canvas> | |
</body> | |
</html> |
# Dependencies | |
Install node 10.16.0 or 12.3.1 from https://nodejs.org | |
# Getting started with node.js rakudo.js | |
The easiest way is to install the rakudo package from npm | |
```bash | |
mkdir tutorial-project # Create a fresh project directory |
Install node 10.16.0 or 12.3.1 from https://nodejs.org
The easiest way is to install the rakudo package from npm
mkdir tutorial-project # Create a fresh project directory