Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

locutus

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

locutus

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

  • 2.0.32
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
345K
decreased by-14.17%
Maintainers
1
Weekly downloads
 
Created

What is locutus?

Locutus is a JavaScript library that provides a collection of functions from various programming languages like PHP, Python, Ruby, and Go. It allows developers to use these functions in JavaScript, making it easier to port code from these languages to JavaScript or to use familiar functions in a JavaScript environment.

What are locutus's main functionalities?

PHP Functions

Locutus provides a variety of PHP functions that can be used in JavaScript. For example, the `strlen` function from PHP can be used to get the length of a string.

const { strlen } = require('locutus/php/strings');
console.log(strlen('Hello World')); // Output: 11

Python Functions

Locutus includes functions from Python, such as the `len` function, which returns the length of an array.

const { len } = require('locutus/python');
console.log(len([1, 2, 3, 4])); // Output: 4

Ruby Functions

Locutus also offers Ruby functions. For instance, the `capitalize` function from Ruby can be used to capitalize the first letter of a string.

const { capitalize } = require('locutus/ruby/strings');
console.log(capitalize('hello world')); // Output: 'Hello world'

Go Functions

Locutus includes functions from Go, such as the `parseInt` function, which can be used to parse a string and return an integer.

const { parseInt } = require('locutus/go/strconv');
console.log(parseInt('42', 10)); // Output: 42

Other packages similar to locutus

Keywords

FAQs

Package last updated on 06 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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