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

get-language-data

v0.0.7

Published

Get data related to programming languages

Downloads

10

Readme

get-language-data

A collection of Programming Language data.

CodeFactor Code Size version MIT

Features

  • [x] Language name
  • [x] File extension
  • [x] Naming convention
  • [x] Logo
  • [x] Language Tag (PrismJS)

Getting Started

npm install get-language-data

or, if you prefer yarn:

yarn add get-language-data

How to Use

getLanguageData

// Import the `getLanguageData` function from the `get-language-data` package.
import { getLanguageData } from 'get-language-data';

// Call the `getLanguageData` function with the language name, or, file extension.
const languageData = getLanguageData({ name: 'Python' })[0];

// Use the `languageData` object to get the language data.
console.log(languageData.name); // Python
console.log(languageData.fileExtension[0]); // py
console.log(languageData.namingConvention); // snake_case
console.log(languageData.prismTag); // python
console.log(languageData.logo); // https://user-images.githubusercontent.com/54644599/227718034-fe84d827-4f53-4466-b37a-2cdd3e817ba2.png
// Import the `getLanguageData` function from the `get-language-data` package.
import { getLanguageData } from 'get-language-data';

// Call the `getLanguageData` function with the language name, or, file extension.
const languageData = getLanguageData({
  prismTag: 'csharp',
})[0];

// // Use the `languageData` object to get the language data.
console.log(languageData.name); // C#
console.log(languageData.fileExtension[0]); // cs
console.log(languageData.namingConvention); // PascalCase
console.log(languageData.prismTag); // csharp
console.log(languageData.logo); // https://user-images.githubusercontent.com/54644599/227718064-c9b9f17a-6f55-4955-85ba-19e2c0420751.png

renameFile

// Import the `renameFile` function from the `get-language-data` package.
import { renameFile } from 'get-language-data';

// Call the `renameFile` function with the file name and the language name, or, file extension.
const sampleFileName = 'sample-file-name.py';

console.log(renameFile({ fileName: sampleFileName })); // sample_file_name.py

Note: Use language name with file name to rename file. Because multiple languages can have the same file extension.

import { renameFile } from 'get-language-data';

const sampleFileName = 'sample-file-name.py';

console.log(renameFile({ fileName: sampleFileName, name: 'python' })); // sample_file_name.py

Available Languages Data

| Language | File Extension | Naming Convention | Tag | Logo | | --- | --- | --- | --- | --- | | C | c cats h idc w | PascalCase | c | | | C# | cs cake cshtml csx | PascalCase | csharp | | | C++ | cpp c++ cc cp cxx h h++ hh hpp hxx inc inl ipp tcc tpp | PascalCase | cpp | | | Dart | dart | PascalCase | dart | | | F# | fs fsi fsx | PascalCase | fsharp | | | GO | go | snake_case | go | | | Haskell | hs hsc | snake_case | haskell | | | Java | java | PascalCase | java | | | JavaScript | js _js bones es es6 frag gs jake jsb jscad jsfl jsm jss njs pac sjs ssjs sublime-build sublime-commands sublime-completions sublime-keymap sublime-macro sublime-menu sublime-mousemap sublime-project sublime-settings sublime-theme sublime-workspace sublime_metrics sublime_session xsjs xsjslib | PascalCase | javascript | | | Julia | jl | snake_case | julia | | | Kotlin | kt ktm kts | PascalCase | kotlin | | | Perl | pl al cgi fcgi perl ph plx pm pod psgi t | snake_case | perl | | | PHP | php aw ctp fcgi inc php3 php4 php5 phps phpt | snake_case | php | | | Python | py bzl cgi fcgi gyp lmi pyde pyp pyt pyw rpy tac wsgi xpy | snake_case | python | | | R | r rd rsx | snake_case | r | | | Ruby | rb builder fcgi gemspec god irbrc jbuilder mspec pluginspec podspec rabl rake rbuild rbw rbx ru ruby thor watchr | PascalCase | ruby | | | Rust | rs rs.in | snake_case | rust | | | Scala | scala sbt sc | camelCase | scala | | | Swift | swift | PascalCase | swift | | | TypeScript | ts tsx | PascalCase | typescript | |

Join us in discussions

We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing, join us in the discussions.