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

grep-open-graph

v0.1.4

Published

grep open-graph meta and custom fields by CSS selector

Downloads

9

Readme

grep-open-graph

grep open-graph lib

Setup

$ npm install --save grep-open-graph

How to use

기본 추출 필드

./lib/fields.js 파일 참조

사용자 정의 필드

{
    multiple: false,     // 예약어. 아직 사용되지 않습니다.
    selector: '.social', // Target CSS selector
    name: 'social',      // output name
    valueType: 'html'    // output type. 'text'(default) | 'html'
}

grepHttpOpenGraph 사용예제

const customFields = [
    {
        multiple: false,
        selector: '.social',
        name: 'social',
        valueType: 'html'
    }
];

grepHttpOpenGraph('https://www.thegajago.com/deals/22008', customFields, 'UTF-8'/** charset optional parameter **/)
    .then((openGraphObj) => {
        console.log(openGraphObj);
    })
    .catch((err) => console.log(err));

/*
{
    ogTitle: '[충남] 태안투어패스 (구매 후 익일 사용가능) 4,000원 - 대한민국 어디든, 가자고!',
    ogType: 'article',
    ogImage: 'https://d1t4fn350b1qbw.cloudfront.net/4e098daa-b143-4372-800b-836f692dfa39.jpg',
    ogUrl: 'http://www.thegajago.com/deals/22008',
    ogDescription: '태안여행 자유이용권 태안투어패스 : 태안천리포수목원 / 태안 빛축제 / 태안 쥬라기박물관 / 팜카밀레 허브농원 / 청산수목원\n#공룡 #자유이용권   #쥬라기박물관   #천리포수목원  #청산수목원  #태안         #태안    #태안빛축제   #태안여행   #태안투어   #태안투어패스   #태안패스   #태투   #투어패스   #팜카밀레   ',
    ogLocale: 'ko_KR',
    ogSiteName: '대한민국 어디든, 가자고! - 우리나라 곳곳의 숨어있는 즐거움을 추천해드려요:)',
    social: '<a data-href="https://www.facebook.com/thegajago/" title="facebook"><i class="icon-facebook"></i></a><a data-href="http://blog.naver.com/start1q" title="naver blog"><i class="icon-blog"></i></a><a data-href="https://www.youtube.com/channel/UC5GHZ6AL_yXpxnPcATCER7w" title="youtube"><i class="icon-youtube-line"></i></a><a data-href="https://www.instagram.com/gajago_insta/" title="instagram"><i class="icon-instagram-line"></i></a>'
}
*/