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

one7-utils

v0.0.4

Published

Module created for facilitated your life ;) Bringing some native PHP modules to the NODE

Downloads

8

Readme

Module created for facilitated your life ;) Bringing some native PHP modules to the NODE

Install

$ npm i one-utils -s

Usage

IMPORT ALL FUNCTIONS

const { GetStr, sleep, curl, gerarCpf, include, rand, randomizador, proxy, proxy1 } = require("one-utils")

FUNCTIONS

  • curl: Function async/await for famous Curl (for request in web or applications)
  • gerarCpf: function for generate CPF valid
  • GetStr: function for exploding strings
  • include: function to include code from another file
  • proxy: function for testing your proxy in server lumtest
  • proxy1: function for testing your proxy in server Google
  • rand: function native of PHP to randomize numbers
  • randomizador: function for randomize strings or keys in array
  • sleep: function async/await for sleeping your application for some time

CURL

const { curl } = require("one-utils")

const _ = async function(){

    let first_req = await curl({
        url: '', // url of site
        method: '', // method of request: GET, PUT, POST, OPTION
        headers: {
            '':''
        },
        proxy: '', // if use proxy, `http://${username}:${password}@${url}:${port}` or `http://${url}:${port}`
        body: '' // if use method POST
    })

    console.log(first_req) // print the result of the request on the console

}()

GerarCpf

const { gerarCpf } = require("one-utils")
// generate cpf without punctuation
let cpf = gerarCpf()
// generate cpf with punctuation
let cpf_with_punctuation = gerarCpf(true)
// print on the console
console.log(cpf, cpf_with_punctuation)

GetStr

const { GetStr } = require("one-utils")

let string = 'hello world, one-utils'

let capture = GetStr(string, ', ', '-') // print 'JohnGrimm'

console.log(string, capture)

INCLUDE

code js: test.js

const { gerarCpf } = require("one-utils")
// generate cpf without punctuation
let cpf = gerarCpf()
// generate cpf with punctuation
let cpf_with_punctuation = gerarCpf(true)

code js: index.js

const { include } = require("one-utils")

include('test.js') // here's including all the code from the test.js file

console.log(cpf, cpf_with_punctuation)

PROXY

const { proxy } = require("one-utils")

const _ = async funtion(){

    let ip_proxy = 'http://127.0.0.1:80'

    let condition = await proxy(ip_proxy)

    if( condition == undefined ){
        console.log(`The Proxy: ${ip_proxy} is OFF`)
    } else if( condition.includes('ip') ){
        console.log(`The Proxy: ${ip_proxy} is ON`)
    } else {
        console.log(`The Proxy: ${ip_proxy} is OFF`)
    }

}()

PROXY1

const { proxy1 } = require("one-utils")

const _ = async funtion(){

    let ip_proxy = 'http://127.0.0.1:80'

    let condition = await proxy1(ip_proxy)

    if( condition == undefined ){
        console.log(`The Proxy: ${ip_proxy} is OFF`)
    } else if( condition.includes('google') ){
        console.log(`The Proxy: ${ip_proxy} is ON`)
    } else {
        console.log(`The Proxy: ${ip_proxy} is OFF`)
    }

}()

RAND

const { rand } = require("one-utils")

let number = rand(0, 999) // print number between 0 - 999

console.log(number)

RANDOMIZADOR

const { randomizador } = require("one-utils")

let keys = ['John', 'Grimm', 'Utils', 'Module']

let randomize = randomizador(keys) // print a random key from the array

console.log(randomize)

SLEEP

const { sleep } = require("one-utils")

const _ = async function() {
    console.log(1)
    await sleep(1000) // declared time in ms
    console.log(2)
}()

Author

👤 JohnGrimm

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 One7. This project is MIT licensed.