npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nw-app-snail

v2.9.15

Published

蜗牛wap页打开app功能支持模块

Downloads

209

Readme

nw-app-snail

功能

在H5中尝试打开网易蜗牛读书App的特定页面,如果没有安装或者没有成功打开,则跳转App下载页

使用

npm: 通过npm安装nw-app-snail,再通过模块引用方式引入即可调用openAppSnail()完成跳转

import openAppSnail from 'nw-app-snail'
//import * as open from 'nw-app-snail'
openAppSnail({
    path: 'bookreview',
    query: {
        bookReviewId: 286436
    }
})

直接引用:下载/dist/bundle.js到工程中即可调用NWAppSnail.openAppSnail()方法完成跳转

<script src="bundle.js"></script>
<script>
    NWAppSnail.openAppSnail({
        path: 'bookreview',
        query: {
            bookReviewId: 286436
        }
    })
</script>

开发

es module 打包

根目录下执行npm run build即可

umd module 打包

本目录下执行npm run build即可

参数

参数为Object类型,参数各字段定义如下:

| 参数属性 | 类型 | 描述 | | --- | --- | --- | | path | String | h5跳转应用内页面类型 | | query | Object | h5跳转应用内页面参数 | | replace | boolean | 是否使用location.replace代理location.href进行跳转,默认为false |

参数示例:

{
    path: 'bookreview',
    query: {
        bookReviewId: 286436
    }
}

具体可用path和query参数如下:

此列表不定时更新,完整列表可查看(蜗牛读书客户端SchemeUrl wiki),此文档展示了所有可供调用的scheme,第一列即为path,第二列即为query所需参数

| path | query | 描述 | | --- | --- | --- | | bookdetail | bookId:书籍id | 书籍详情 | | bookcontent | bookId:书籍id articleId:章节id 非必传| 书籍正文页 | | booklist | bookListId:书单id | 书单页(书单功能已弃用) | | webview | url:打开的连接地址 inside:boolean变量,是否用内嵌浏览器打开,默认为false(即外部浏览器打开) | 通过浏览器或者webview打开url | | userinfo | uuid:用户uuid | 用户个人主页 | | privatemsg | useruuid:用户uuid | 用户私信对话界面 | | bookrank | moduleId:模块id entryId:排行榜id title:榜单名称 type:榜单类型(read:在读榜,new:新书榜)| 书籍排行榜 | | bookreview | bookReviewId:书评id | 书评详情页 | | newbookreview | 无 | 写书评 | | question | questionId: 问题id | 问题回答页 | | questionlist | bookId: 书籍id | 书籍的问题列表 | | bookstore | 无 | 书城(目前的分类页) | | messagenotify | 无 | 消息列表通知选项卡 | | messagecomment | 无 | 消息列表评论选项卡 | | messageanswer | 无 | 消息列表回答选项卡 | | messagelist | 无 | 我的消息列表 | | feedback | 无 | 用户反馈 | | followlist | type:follow表示关注列表,fans表示粉丝列表 uuid:用户uuid,如果不传表示当前登录用户| 用户反馈 | | setting | 无 | 设置 | | subject | moduleId:模块id entryId:专题id(如果不传表示获取专题列表)| 专题页 | | bookexchange | type:exchanged表示已兑换页面,book表示兑换页面 | 书籍兑换页面 | | ... | 更多可控调用的scheme请查看(蜗牛读书客户端SchemeUrl) | 如无权限可联系hzliushichuan |