posts with tag javascript
Install Global npm Package For Current User Without Privilege
2017-07-30
NPM is the most used package manager for node.js and JavaScript ecosystems. By using the global packages mechanism, a node.js package can be easily integrated into system shell and just works like a native command line utility (or even an desktop GUI program). However, by default, the global packages are installed as shared global packages across users and requires root privilege for maintenance, which may be unavailable for general user and also expose potential conflict of packages between users. This post will cover simple configuration for npm global package for current user only.
Use Glup to Make Life Easy
2015-09-14
task-1, task-2, task-3, task-4, … Everyone who working in front end web page development will have some trivals repeating and repeating. Imagine that you are creating a web page from scratch, you need to design the all the pages arrage the relationships between different pages and other websides. Then you need to implement every single pages. You should figure out the common part and reusable part and put them together, and use some client-side or server-side mothods to merge all different part together and represent a perfectly metched web page to your audience. If you achieve the goal via a client side method such as frameset of iframe tag in web page, then you can hardly prevent user directly visit a fragment of a layer of your final site. In some other scrnarios, some one directly use the same method as you do to put your site fragment into their web pages. Isn’t it annoying?
Use RequireJS in Your Site
2015-09-12
<script src=”/script/Script.js”></script> ? require(“Script”); ? For most of the websites that you visit everyday, the JavaScript is not only a additional way to promote user experience but also a required method to let the site works as expectation. Nowadays, in such a so called “web 2.0” era, what is loaded and rendered by a browser is not a traditional document-like web-page but a modern program-like web-application. And since the HTML5 and CSS3 ( as well as other “live standands” ) became widely used in most websites form top of Alexa ranking to those personal blog (like this), it’s rare to meet a pure static site(in terms of client end). The scorces drive all of world of web is in JavaScript, our hero. However, just as the name, “JavaScript”, indicates that it’s initial goal is only provide some simple way for website to use, JavaScript is not designed for large scale application. The conflict between the autologous fault of the language nature and the raising demand of a suitable language led to various solutions. Here in this post, I would like to talk about some things about RequireJS, a JavaScript file and module loader who modulize JavaScript code snippits and load them asynchoronously in the standand browswer environment.