Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/data/zadanie01/sum.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
108
6 changes: 3 additions & 3 deletions app/data/zadanie02/data.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"data" : "Nie musisz rozkodowywać tego JSONa!",
"example" : "To tylko przykład :)"
{
"data" : "Nie musisz rozkodowywać tego JSONa!",
"example" : "To tylko przykład :)"
}
15 changes: 8 additions & 7 deletions app/data/zadanieDnia/test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
You Don't Know JS: ES6 & Beyond
Foreword

Kyle Simpson is a thorough pragmatist.

I can't think of higher praise than this. To me, these are two of the most important qualities that a software developer must have. That's right: must, not should. Kyle's keen ability to tease apart layers of the JavaScript programming language and present them in understandable and meaningful portions is second to none.
[https://github.com/getify/You-Dont-Know-JS/blob/master/es6%20%26%20beyond/foreword.md]
yOu dOn't kNoW Js: Es6 & BeYoNd
FoReWoRd

KyLe sImPsOn iS A ThOrOuGh pRaGmAtIsT.

I CaN'T ThInK Of hIgHeR PrAiSe tHaN ThIs. To mE, tHeSe aRe tWo oF ThE MoSt iMpOrTaNt qUaLiTiEs tHaT A SoFtWaRe dEvElOpEr mUsT HaVe. ThAt's rIgHt: MuSt, NoT ShOuLd. KyLe's kE
eN AbIlItY To tEaSe aPaRt lAyErS Of tHe jAvAsCrIpT PrOgRaMmInG LaNgUaGe aNd pReSeNt tHeM In uNdErStAnDaBlE AnD MeAnInGfUl pOrTiOnS Is sEcOnD To nOnE.
[hTtPs://gItHuB.CoM/GeTiFy/yOu-dOnT-KnOw-jS/BlOb/mAsTeR/Es6%20%26%20BeYoNd/fOrEwOrD.Md]
18 changes: 17 additions & 1 deletion app/zadanie01.js
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
//Twój kod
//Twój kod

const fs = require("fs");

fs.readFile('./data/zadanie01/input.json', (err, data) => {
if (err === null) {
let sum = JSON.parse(data).reduce((a,b)=>{return a+b;});
fs.writeFile('./data/zadanie01/sum.txt',sum, err => {
if (err===null){
console.log("Zapisano popranie!")
} else
console.log("Blad zapisu!")
})
} else
console.log('Blad odczytu')

});
13 changes: 12 additions & 1 deletion app/zadanie02.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
//Twój kod
//Twój kod

const fs = require("fs");

fs.readdir('./data/zadanie02',(err,files)=>{
if(err===null){
files.forEach(file =>{
console.log(file);
})
} else
console.log('Blad odczytu!')
});
25 changes: 24 additions & 1 deletion app/zadanieDnia.js
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
//Twój kod
//Twój kodc
const fs = require('fs');
const nazwa = process.argv[2];

let parse = (el,i)=>{
if(i % 2 !== 0){
return el.toUpperCase();
}else{
return el.toLowerCase();
}
};

fs.readFile(nazwa, 'utf-8',(err, data )=> {
if (err===null){
let arr = data.split('').map(parse).join('');
fs.writeFile(nazwa, arr ,er=>{
if (er === null){
console.log('Udane!');
} else
console.log('Blad odczytu!');
})
} else
console.log('Blad odczytu' + err );
});