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

@aegis-framework/artemis

v0.3.29

Published

Aegis Framework Javascript Library

Downloads

78

Readme

Artemis

Artemis is a JavaScript Library that aims to provide common utilities needed during development such as DOM manipulation, a wrapper for client based Storage and other functions that may be useful for web app development.

Using it

Artemis is provided as a CommonJS, ES6 and global library.

Browser

<script src='./artemis.min.js'></script>
const { $_, Text } = Artemis;

ES6 Modules

import { $_, Text } from '@aegis-framework/artemis';

Node JS

const { $_, Text } = require ('@aegis-framework/artemis');

Below are some simple examples but you can read the full documentation of each class for more details.

Classes

DOM

Artemis core library focuses on DOM manipulation, providing a jQuery-like experience and API

$_ready (()=> {
	$_('body').append ('<h1>Some Title</h1>');
    $_('h1').text ('A different title');
    $_('h1').style ('color', '#424242');
});

Form

Artemis also includes a small form utility class that helps with filling and retrieving values from a form.

<form data-form="MyForm">
	<input type="text" name="SomeInput">
	<input type="text" name="OtherInput">
</form>
Form.fill ('MyForm', {
	'SomeInput': 'Here is some Value',
    'OtherInput': 'And here’s another one'
});

console.log (Form.values ('MyForm'));

Space

The Space Library is a wrapper for simple storage solutions as Local and Session storage but provides data independence through storage namespaces and versioning.

let space = new Space (SpaceAdapter.LocalStorage, {
	name: 'Storage',
	version: '0.1.0'
});

space.set ('Test', {
    value: 'Some Value'
}).then (({key, value}) => {
    console.log ('The value was inserted correctly!');
});

space.get ('Test').then ((value) => {
    return value;
}).then (({key, value}) => {
    console.log (value);
});

space = new Space (SpaceAdapter.LocalStorage, {
	name: 'Storage',
	version: '0.1.1'
});

space.upgrade ('0.1.0', '0.1.1', (storage) => {
    return storage.set ('Test', {
		value: 'Other Value'
	});
});

Request

The request library provides a simple way to send HTTP requests using the fetch API.

Request.get ('https://example.com/api/', {
	'someQueryParam': 'Some Query Value!'
}).then ((response) => {
	return response.text ();
}).then ((text) => {
	console.log (text);
});

Request.post ('https://example.com/api/', {
	'someKey': 'Some Value!'
}).then ((response) => {
	return response.text ();
}).then ((text) => {
	console.log (text);
});

Platform

The platform library provides several utility methods to obtain information about the platform in which the code is running.

if (Platform.mobile ('Android')) {
	console.log ('You are running this on Android!');
} else if (Platform.mobile ()) {
	console.log ('You are running this on some kind of mobile device!');
} else if (Platform.desktop ('macOS')) {
	console.log ('You are running this on a Mac!');
}

if (Platform.electron ()) {
	console.log ('You are running this on a Electron!');
} else if (Platform.cordova ()) {
	console.log ('You are running this on a Cordova!');
}

Text

The text library provides simple utility methods to perform text transformations or other text related functions.

console.log (Text.capitalize ('is this text capitalized?'));
// Logs: Is This Text Capitalized?

console.log (Text.suffix ('Hello', 'Hello how are you?'));
// Logs: how are you?

console.log (Text.prefix ('how are you?', 'Hello how are you?'));
// Logs: Hello

Util

The util library provides diverse methods that could be useful for some applications

console.log (Util.uuid ());
// Logs: Some UUID such as 116a7d96-8c6c-46ee-a9e1-3c7183e691b5

function test () {
	console.log ('A simple Function');
}

Util.callAsync (test).then (() => {
	console.log ('Test was executed and a promise was inserted so test behaves like a function using promises');
});