Code Monkey home page Code Monkey logo

localstor's Introduction

localstor


实现本地存储js和css文件,当js或css文件有改动时才重新加载文件,可以有效减少http请求次数,加快页面的响应时间。

安装方法:

$npm install localstor --save

入口方法:

//引入js:     
local.load.loadJs(name, url, version, callback);  
//引入css:  
local.load.loadCss(name, url, version); 

参数说明

name:引入文件的名称
url:引入文件的路径
version:文件版本号
callback:回调函数

说明:
1.当需要重新加载新的js或css文件的时候,只需要把文件版本号(version)修改一下就可以了。
2.由于js文件的引用会有先后之分,所以先引入的js文件要放在 最外层引入。

具体可以看看demo文件里的实例。

localstor's People

Contributors

juntaozhou05 avatar juntaozhou avatar

Stargazers

Roman avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

littleveigar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.