{Carrer web log}
o - JS Library for Object Manipulation
Tuesday, August 23, 2011 { 0 Comments }
o - is simple lightweight JavaScript library for basic object manipulation. Compressed and gzipped weights around 0,5 kb. It should work on IE 5.5 and latter. Also there is lite version that doesn't make hasOwnProperty check that will run faster and with less code.Lately I was having fun making some JavaScript projects like Object Auto Documentation https://github.com/vladocar/AutoObjectDocumentation and Multiple object extend pattern in JavaScript http://www.vcarrer.com/2011/06/multiple-object-extend-pattern-in.html that are both object related.
When I was working on Object Auto Documentation I realized that can be handy if I had small library for dealing exclusively with JS objects.
That is how the idea for this library was born. Basically this library is nothing new or glamorous is just the tool I needed. The library contains methods like adding, removing values in the object, extracting object keys and values, object extending and cloning, transforming the object to JSON and JSON to object and many more..
The goal of this JavaScript is to make fast object interrogation without many error and property checking. From the primary tests I made this library should work even in IE 5.5. If you are using toJSON and toObject methods you should also include Douglas Crockford JSON.js file.
I also included the lite version that is basically the same code only without hasOwnProperty verification for speed gain.
One thing that surprised me is the native Object.keys method for extracting values is slower than for in loop method. Here are some speed tests that I find on jsperf.com http://jsperf.com/object-keys-iteration/3 and http://jsperf.com/object-keys-vs-for-in-for-values/2 .
I decided to implement the native Object.keys method for modern browsers and for in loop method for older browsers, in many browsers the native method is slower then for in method but probably the Object.keys will get some speed optimization in the future browsers. If you are using o-lite.js you will experience the pure velocity of .keys and .values method.
This library is inspired by underscore.js with the main focus on JavaScript Objects. The speed in this library is achieved by simply not doing any kind of error check. That means that you should do all the error checks outside of the library or modify the library (it is very easy because there are few lines of code) or be aware what this library does and how it’s made.
Here are the list of all the methods with examples.
The structure of the library (Auto Documentation)
Download the library on GitHub
Fell free to suggest code and speed improvements and also to suggest new methods for exploring the JavaScript Object.
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- AI Prompt Directory
- Hand Drawn Icons
- Font Design Inspiration
- Font Pairings
- Free SVG Cut File
- Upcoming NFT projects
- Discord Tutorials
- Free Sublimation Designs
- Tech Feed
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- 1 line CSS Grid Framework
- Two Lines CSS Framework
- Child Selector System - CSS Framework
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
- CSS3 Action Framework
- CSS Mini Reset
- HTML5 Mini Template
- CSS Mobile Reset
- picoCSS - JavaScript Framework
- HTML Lorem Ipsum Crash Test
- Object Auto Documentation - JavaScript
- o - JS Library for Object Manipulation
- Foxy - CSS Framework
- Tumblr Free Theme - Better Readability Project
- Box - CSS Framework
- SMART CSS GRID
- nanoJS - Minimal JS DOM Library
- Flexy CSS Framework
- Katana is CSS Layout System made with Flexbox
- Micro CSS Reset
- 60 Grid System
- Simple CSS Button
- ramd.js JavaScript library for making web applications.
- Minimal Notes web app build with Vue.js
- Scribble Font for Prototyping & Wireframing
- Flex One - 1 CSS Class System
- Floaty - CSS Float Based Layout System
- Infinity CSS Grid
- CLI Convert websites into readable PDFs
- keywords-extract - CLI tool, extract keywords from any web page.
- screenshoteer - Make website screenshots and mobile emulations from the command line.
- Basic.css - Classless CSS Starter File
§§Previous Posts <<<
- GPT-3 and CSS Frameworks
- Don’t use CSS Reset use CSS Set
- One Page 2020 Calendar Print Version
- 3 CLI tools based on Node.js
- Scribble Font for Prototyping & Wireframing
- ramd.js - Small JavaScript library for making TODO...
- Katana.scss - CSS Layout System made with Flexbox
- Flexy CSS Framework
- nanoJS - JavaScript for DOM manipulation
- SMART CSS GRID
§Archives <<<
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- October 2006
- January 2007
- February 2007
- October 2007
- April 2008
- June 2008
- July 2008
- August 2008
- September 2008
- November 2008
- December 2008
- January 2009
- February 2009
- March 2009
- April 2009
- May 2009
- June 2009
- August 2009
- September 2009
- October 2009
- November 2009
- December 2009
- January 2010
- February 2010
- March 2010
- April 2010
- May 2010
- June 2010
- July 2010
- August 2010
- September 2010
- October 2010
- November 2010
- December 2010
- January 2011
- February 2011
- March 2011
- April 2011
- May 2011
- June 2011
- July 2011
- August 2011
- September 2011
- October 2011
- November 2011
- December 2011
- January 2012
- February 2012
- March 2012
- April 2012
- June 2012
- August 2012
- November 2012
- January 2013
- March 2013
- June 2013
- October 2013
- November 2013
- March 2014
- September 2014
- October 2014
- November 2015
- March 2018
- May 2018
- June 2018
- July 2018
- October 2018
- January 2019
- January 2020
- June 2020
- April 2021
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License