Skip to content

ugursogukpinar/Penguins.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Penguins.js

Shortening JS Code
Get the lastest release here!
View all releases on GitHub

Penguins.js is a portable, easy to use JS library. It can shorten down your code ridiculously:

Example

HTML code:

<!DOCTYPE HTML>
<HTML>
<HEAD>
<META CHARSET="ISO-8859-1">
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<BUTTON ID="boringButton">Boring button</BUTTON>
</BODY>
</HTML>

Vanilla JS Code:

var boringButton = document.getElementById('boringButton');
boringButton.onclick = function(){
 var newParagraph = document.createElement('p');
 newParagraph.innerHTML = 'You clicked the boring button!';
 document.body.appendChild(newParagraph);
};

Same JS Code with Penguins.js:

_('#boringButton').onEvent('click', function(){
 _('body').addElement('p', 0, 'newP').set('innerHTML', 'You clicked the boring button!');
};

In this example, Penguins.js saves you from writing 3 extra lines of code!

Documentation

Packages

No packages published

Languages

  • JavaScript 61.4%
  • HTML 38.6%