New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lets-get-meta

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lets-get-meta - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

index.js

@@ -7,4 +7,4 @@ var cheerio = require("cheerio")

$("meta").each(function(i, tag){
var k = $(this).attr('name')
var v = $(this).attr('content')
var k = $(this).attr('name') || $(this).attr('property')
var v = $(this).attr('content')
if (k && v) meta[k] = v

@@ -11,0 +11,0 @@ })

{
"name": "lets-get-meta",
"version": "2.0.1",
"version": "2.1.0",
"description": "Extract meta tags from an HTML string in Node.js (not browsers)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,4 +18,4 @@ # lets-get-meta

// Pass and HTML string
getMeta("<meta name='page' content='index'><meta name='description' content='This is the index page'>")
// Pass an HTML string that includes name and/or property metatags
getMeta("<meta name='page' content='index'><meta property='description' content='This is the index page'>")

@@ -22,0 +22,0 @@ // Get back an object

@@ -15,6 +15,7 @@ var assert = require("assert")

it("extracts name and content from meta tags in an HTML string and returns a key-value object", function() {
it("extracts name or property and its content from meta tags in an HTML string and returns a key-value object", function() {
assert.deepEqual(m(fixtures.simple), {
foo: "yes",
bar: "no"
bar: "no",
'og:title': 'page title'
})

@@ -21,0 +22,0 @@ })

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc