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-lofter

v2.9.0

Published

Open Lofter App

Downloads

10

Readme

nw-app-lofter

功能

在H5中尝试打开Lofter App内的特定页面,如果没有安装APP,则跳转App下载页

重要更新

  • 2022-12-05 增加一项参数incantation,用于设置打开app的中转页的指定剪切板内容,防止被默认的下载归因剪切板内容覆盖

使用

npm: 通过npm安装nw-app-lofter

import {openAppLofter} from 'nw-app-lofter'
openAppLofter({
    path: 'webview',
    query: {
        url: 'http://qatest5.lofter.com'
    }
})

参数

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

| 参数属性 | 类型 | 描述 | | --- | --- | --- | | path | String | webview或具体页面类型 | | query | Object | 参数 | | act | String | 非必须,活动包统计参数,跳下载会携带 | | incantation | String | 非必须,path为WebView时,如未安装app,跳转下载中转页后,点击该页下载按钮需要写入剪切板的字符串 |

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

| path | query | 描述 | | --- | --- | --- | | app | 无 | 只唤起app,不跳转其他页面 | | webview | url:WAP页面的url | 如果指定WAP页面已实现APP打开功能,则打开APP内的对应页面;否则通过webview打开 | | homepage | id:用户id | 个人主页 | | post | id: 帖子id,userId:用户id | 单日志页 | | tag | tagName:标签名 | 标签页 | | publishText | userId:用户id,tagName:标签名(逗号分隔) | 发布文字页 | | publishPhoto | userId:用户id,tagName:标签名(逗号分隔) | 发布图片页 | | publishVideo | userId:用户id,tagName:标签名(逗号分隔) | 发布视频页 |

其中,path为webview时,url指定为WAP页url。如APP可打开对应页面,则打开;否则通过webview打开。

示例:

个人主页

{
    path: 'webview',
    query: {
       // 个人主页WAP页url
       url: 'http://qatest5.lofter.com'
    }
}

{
    path: 'homepage',
    query: {
        id: 'qatest5'
    }
}

单日志页

{
    path: 'webview',
    query: {
       // 单日志页WAP页url
       url: 'http://newsexpress.lofter.com/post/1e7dc1d6_cea03e7'
    }
}

{
    path: 'post',
    query: {
        id: '1e7dc1d6_cea03e7',
        userId: 'newsexpress'
    }
}

标签页

{
    path: 'webview',
    query: {
       // 标签WAP页url
       url: 'http://www.lofter.com/tag/%E9%9F%B3%E4%B9%90'
    }
}

{
    path: 'tag',
    query: {
        tagName: '音乐'
    }
}

发布文字页

{
    path: 'webview',
    query: {
       //发布文字WAP页面url   
       url: 'http://www.lofter.com/blog/qatest5/new/text?extraTags=%E9%9F%B3%E4%B9%90,music,happy%20new%20year'
    }
}

{
    path: 'publishText',
    query: {
        userId: 'qatest5',
        tagName: '音乐,music,happy new year'
    }
}

等等...