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

azure-sas-token

v0.0.46

Published

simple node lib to generate azure sas token

Downloads

61

Readme

Azure SAS token generator

A simple JavaScript Azure SAS token generator

The current project is about how to programmatically generate a Shared Access Signature (SAS) token to use with Postman in order to post messages to Azure Service Bus Topic/Queue.

NPM GitHub issues Snyk Vulnerabilities for npm package npm npm bundle size npm bundle size npm GitHub deployments HitCount

Motivation

After googling for a while in order to generate the necessary token, to post messages to Azure service bus, I noticed that there is no clear explanations, how to achieve it in JavaScript!! I'm proud to offer you a simple JS way to generate Azure SAS token - using node - or angular.

Features

azure sas token generation in node Don't forget to let me a Star ⭐ :-)

Installation

npm install azure-sas-token

Code Example

js-standard-style

import { createSharedAccessToken } from 'azure-sas-token';

// default token validity is 7 days
let sasToken = createSharedAccessToken('https://<service namespace>.servicebus.windows.net/<topic name or queue>',
								'<signature key name>',
								'<signature hash>');
console.log(`sasToken: ${sasToken}`);

// Specify your own validity in secs, two hours in this example
sasToken = createSharedAccessToken('https://<service namespace>.servicebus.windows.net/<topic name or queue>',
								'<signature key name>',
								'<signature hash>', 
								60 * 60 * 2);
console.log(`sasToken: ${sasToken}`);

Posting messages in Azure service-bus queue - tutorial

https://github.com/ah584d/azure-send-message-to-service-bus-with-postman

POST https://<yournamespace>.servicebus.windows.net/<yourentity>/messages
Content-Type: application/json
Authorization: SharedAccessSignature sr=https%3A%2F%2F<yournamespace>.servicebus.windows.net%2F<yourentity>&sig=<your token generated by this repository code>&se=1438205742&skn=KeyName

Tests

Done!

Build status

GitHub deployments

contributions welcome

Credits

The only related topic that I founded on Microsoft Azure help

https://docs.microsoft.com/en-us/rest/api/eventhub/generate-sas-token

Icon from: http://www.kameleon.pics

License

A short snippet describing the license (MIT, Apache etc)

MIT © Avraham Hamu