hash-parse

hash parse and set

Usage no npm install needed!

<script type="module">
  import hashParse from 'https://cdn.skypack.dev/hash-parse';
</script>

README

hash-parse

hash解析与设置

npm install hash-parse 
import hash from 'hash-parse';

hash.parse('https://github.com/#name=hash'); // {name: 'hash'}

// 如果当前URL=https://github.com
hash.set({ name: 'hash', version: '1.0.0' })  // https://github.com/#name=hash&version=1.0.0

// 删除hash中的参数name
hash.del('name')  // https://github.com/#version=1.0.0

// 删除多个参数
hash.del(['name','version'])  // https://github.com/