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

vue-parsing-url-contentn

v0.1.5

Published

解析web url数据

Downloads

4

Readme

vue-parsing-url-contentn

This is a simple URL parsing component based on Cheerio and dompurify. Users can try to create a better component to share on their own.

Project install

npm i vue-parsing-url-contentn

Global usage examples

import ParsingURLContent from "vue-parsing-url-contentn";
Vue.use(ParsingURLContent);

<template>
  <div>
    <ParsingURLContent :url="xxx" />
  </div>
</template>

Example of standalone use


<template>
  <div class="container">
    <h1>parsedContent</h1>
    <p v-html="editor"></p>
    <input type="text" v-model="editor" placeholder="Enter webpage URL">
    <ParsingURLContent :url="editor" @parsedContent="parsedContent"></ParsingURLContent>
  </div>
</template>
<script>

import ParsingURLContent from "vue-parsing-url-contentn";
export default {
  components: {
    ParsingURLContent
  },
  data () {
    return {
      editor: null,
      testUrls: [
        'https://www.npmjs.com/package/gif',
        'https://webpack.js.org/concepts/#loaders',
      ]
    }
  },
  mounted () {

    this.editor = this.testUrls[0]

  },
  methods: {
    parsedContent (content) {
      // console.log(content)
    }
  },
}
</script>
<style scoped></style>


JS function

 import { ParsURLJS } from "vue-parsing-url-contentn";
    ParsURLJS(this.editor).then(res => {
    console.log(res) ;//{response , parseContent}
 });

使用提醒

(Resolve cross domain issues on their own)
1.按照代码示例进行编写 传入正确的url 即可
2.该组件可能会提示配置loader的错误  需要在vue.config.js配置 示例
 // 添加对htmlparser2模块的处理
    config.module
      .rule("htmlparser2")
      .test(/htmlparser2[\\/]lib[\\/]esm[\\/]index\.js$/)
      .use("babel-loader")
      .loader("babel-loader")
      .options({
        presets: ["@babel/preset-env"],
      });

    // 添加对parse5模块的处理
    config.module
      .rule("parse5")
      .test(/parse5[\\/]dist[\\/]index\.js$/)
      .use("babel-loader")
      .loader("babel-loader")
      .options({
        presets: ["@babel/preset-env"],
      });

      babel.config.js :
      module.exports = {
        presets: ["@vue/cli-plugin-babel/preset"],
      };