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

slangopedia

v0.2.0

Published

A Node.js API for slangopedia.se

Downloads

4

Readme

slangopedia

A Node.js API for Slangopedia

Install

npm install slangopedia

Usage

Setup

const Slangopedia = require('slangopedia')

Search

.search(searchTerm, [options])
Slangopedia.search('yani').then(console.log)
//=> { 
//=>  definitions: [...],
//=>  word: 'yani',
//=>  url: 'http://www.slangopedia.se/ordlista/?ord=Yani'
//=> }
Options
includeComments (default: false)
random (default: false)

Example of a response definition object

{
  "definitionId": 21740,
  "content": "Uttalas ungefär ja:ni eller jæ:ni. Ordet är ett lån från turkiska som i sin tur har lånat det från arabiska. I arabiska är ordet \"yani\" en sorts konjunktion som ofta jämförs med svenskans \"asså, du vet, liksom, typ eller så att\".",
  "example": "Exempel 1.\n- Yani han tror han är smart.\n\nExempel 2.\n- Varför ska vi dit?\n- Yani det är inte för min skull.\n\nExempel 3.\n- Var är Jasmin?\n- Hon sa att hon var tvungen att gå hem.\n- Yani hon låtsas vara upptagen.",
  "author": "Dennis_1996",
  "createdAt": 1377618674000,
  "rating": {
    "upvotes": 102,
    "downvotes": 39,
    "totalVotes": 141,
    "stars": 4,
    "upvotePercentage": 72.34
  },
  "tags": [
    "yani",
    "asså",
    "typ",
    "arabiska",
    "turkiska",
    "yanii"
  ]
}

Get a random word

.random()
Slangopedia.random()
//=> { 
//=>  definitions: [...],
//=>  word: 'Smalfet',
//=>  url: 'http://www.slangopedia.se/ordlista/?ord=Smalfet'
//=> }

Get definition comments by definitionId

.comments(definitionId)
Slangopedia.comments(2094).then(console.log)
//=> [{
//=>   content: 'jag göra det?',
//=>   author: 'aa',
//=>   createdAt: 1383778800000
//=> }]

Vote on a definition

.voteUp(definitionId)
.voteDown(definitionId)
Slangopedia.voteUp(2094).then(console.log)
//=> { didVote: true }

Slangopedia.voteDown(2094).then(console.log)
//=> { didVote: true }

Add a definition for a new or existing word

.addDefinition(definitionRequest)

If the request is successful, Slangopedia moderators will review the definition before publishing it.

const definitionRequest = {
	word: 'wörd',
	content: 'The definition goes here',
	example: 'The definition example goes here',
	tags: 'tag, another, third', // minimum of 2
	author: 'Gandalf',
	city: 'Aman',
	email: '[email protected]'
}

Slangopedia.addDefinition(definitionRequest).then(console.log)
//=> {
//=>	didPost: true|false,
//=>	data: {...}, // Included if post was successful
//=>	reason: 'Something went wrong on definition approval' // Included if post failed
//=> }

License

MIT