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

a-toolbox

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-toolbox

javascript lightweight basic tools, zero dependecies, isomorphic

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
235
decreased by-16.07%
Maintainers
1
Weekly downloads
 
Created
Source

a-toolbox

NPM Version NPM Downloads

JS Standard Style

javascript lightweight basic tools, zero dependecies, isomorphic

Purpose

"This is my rifle. There are many others like it, but this one is mine."

Install

npm i a-toolbox --save

Quick start

const tools = require('a-toolbox');

tools.string.trim('({cut these brackets please)}', ['{', '}', '(', ')'])
// > 'cut these brackets please'

On browser

<script src="node_modules/a-toolbox/dist/atoolbox.min.js"></script>
<script>
var data = {
  name: 'Alice',
  year: 2014,
  color: 'purple'
};

var str = '<div>My name is {name} I was born in {year} and my favourite color is {color}</div>{nothing}';
console.log('template:', tools.string.template(str, data));

//> template: <div>My name is Alice I was born in 2014 and my favourite color is purple</div>{nothing}
</script>

API

documentation in progress

array

todo

fs

note: not available on browser

fs.exists(path)
  • path <string> file path
  • return: Promise.<boolean> true if file exists - and it's a file

replace deprecated fs.exists

Example

tools.fs.exists('/tmp/file')
// > true
fs.touch(path)
  • path <string> file path
  • return: Promise.<void>

create an empty file if not exists

Example

tools.fs.touch('/tmp/touch-me')

fs.unlink(path, [safe=true])
  • path <string> file path
  • [safe=true] <boolean> safe do not throw exception
  • return: Promise.<void>

delete file, optionally in safe mode

Example

tools.fs.unlink('/tmp/file')

hash

todo

object

todo

random

todo

string

todo

sys

note: not available on browser

todo

task

todo

time

todo

util

util.isSet()
  • return: bool

check if val is setted, means it's not null or undefined

util.onBrowser()
  • return: bool

check if you are on browser or not


Changelog

v. 1.0.0

  • general review
  • modular loader
  • browser version

TODO

  • doc (readme, api)
  • tdd via tollo
  • keywords in github and package.json

License

The MIT License (MIT)

Copyright (c) 2015-2018, braces lab

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 10 Jan 2018

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