Supriya Ghosh (Editor)

FuncJS

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Original author(s)
  
Sharikul Islam

Development status
  
Active

Developer(s)
  
Sharikul Islam

Written in
  
JavaScript

Initial release
  
November 1, 2012 (2012-11-01)

Stable release
  
1 / February 2013 (2013-02)

FuncJS is an open source functions only JavaScript library that aims to speed up web development time in the JavaScript programming language by providing 22 pre-written functions made available throughout both releases. FuncJS is intended to allow JavaScript programmers to get the basic areas completed quickly, and let them focus on more larger, code-centric areas of development. As of November 2012, FuncJS is a relatively new product and is in version one of its stable release.

Contents

Functions

In January 2013, FuncJS 2 was released which got rid of many functions, and renamed some functions. However, the new files were uploaded onto GitHub, but it's a temporary action, as according to the repository's README file. Here's the new list, as according to the new documentation:

  • echo()
  • function_exists()
  • strlen()
  • strpos()
  • str_replace()
  • up()
  • down()
  • store()
  • str_rev()
  • grab()
  • trim()
  • count()
  • strip_tags()
  • show_tags()
  • Importing FuncJS to webpages

    FuncJS is available in two versions; minified (compressed) and an uncompressed version, both of which are to be used separately from each other. Similar to other JavaScript libraries, FuncJS can be imported onto a webpage by including it via the "script" HTML tag:

    According to the documentation, users should make sure FuncJS is loaded and working properly on their webpages by checking whether the browser recognises the FuncJS object:

    Both versions of FuncJS are hosted by FuncJS itself, as demo's suggest that FuncJS is only available through their servers. However, although FuncJS allows users to download a local copy of the file to their own machines, it deeply encourages that users import FuncJS into their webpages through linking it via a URL as "this ensures that you (the user) have any new updates to the file made available to you."

    Using FuncJS in webpages

    Since function's from FuncJS are seen by the browser as regular functions, they would have to be written within "script" tags and would be checked and executed by the browser's JavaScript engine (such as Google Chrome's V8 JavaScript Engine). As seen by the documentation's, function's from FuncJS are designed to fit into normal JavaScript code, therefore not breaking the "flow" of writing JavaScript code. Take this example (from the documentation website):

    which checks a given condition, and displays text depending on the outcome. As seen by the example, the "echo" function can be considered as a part of JavaScript, similar to PHP.

    References

    FuncJS Wikipedia